Código HTML:
function edad(Fecha,helperMsg){ fecha = new Date(Fecha) hoy = new Date() ed = parseInt((hoy -fecha)/365/24/60/60/1000) if (ed < 18) { alert(helperMsg); Fecha.focus(); return false; } return true; }
Código HTML:
<input type="text" name="nacimiento" id="nacimiento" size="32" style="cursor:text;background:#CCC;" onClick="ds_sh(this);" readonly="readonly" onBlur="edad(this,'Usted no es mayor de edad, por favor contacte a su representante.');">
Por eso me dirijo a ustedes los foreros, cualquier ayuda es altamente agradecida.
Saludos!