In a file js, thanks to the help and more research, I have already validated the correction of a date provided by the user. As it is a date of birth I would like to be able to control that it was not superior to the current date. In the following code, how do I incorporate the described control? Thank you in advance.
function validaEdat(){
vesSumant();
vfalladata = false;
//Comprovació de la data de naixement i el correu electrònic
var vregexNaix = /^(((0{0,1}[1-9]|[12][0-9]|3[01])([/])(0{0,1}[13578]|10|12)([/])(\d{4}))|((0{0,1}[1-9]|[12][0-9]|30)([/])(0{0,1}[469]|11)([/])(\d{4}))|((0{0,1}[1-9]|1[0-9]|2[0-8])([/])(0{0,1}2)([/])(\d{4}))|((29)(\.|-|\/)(0{0,1}2)([/])([02468][048]00))|((29)([/])(0{0,1}2)([/])([13579][26]00))|((29)([/])(0{0,1}2)([/])([0-9][0-9][0][48]))|((29)([/])(0{0,1}2)([/])([0-9][0-9][2468][048]))|((29)([/])(0{0,1}2)([/])([0-9][0-9][13579][26])))$/;
-->
vdataNaix = document.formu.dataNaix.value;
vanyData = vdataNaix.substring(vdataNaix.length-4, 4);
if((!vregexNaix.test(vdataNaix)) || (/^(\d{4})$/.test(vanyData))){
alert("Bonvolu skribi vera naskighdato per tt/mm/jjjj. \n--------------------------------------\n Per favor, una data vera com dd/mm/aaaa.");
document.formu.dataNaix.value = "";
document.formu.dataNaix.focus();
return false;
}
controlaCaselles();
return true;
}