/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function InscrIsDate(dateStr) {

var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
var matchArray = dateStr.match(datePat); // is the format ok?

if (matchArray == null) {
return false;
}
return true;
}


function canviarData() {
    var txt;
    txt=document.forms['frm'].elements['diaN'].value + '-' + document.forms['frm'].elements['mesN'].value + '-' + document.forms['frm'].elements['anyN'].value
    if (InscrIsDate(txt))
        document.forms['frm'].elements['data_naix'].value=txt;
    else
        document.forms['frm'].elements['data_naix'].value='';
}
