Hola
helthon
A ver si te he entendido bien. Pon así el campo de texto:
<input type="text" onblur="validar(this)" />
y usa este código:
Código PHP:
function validar(obj) {
hoy = new Date();
fecha = new Date(obj.value);
hoy.setTime(hoy.getTime()-2*24*60*60*1000); // restamos 2 días
if (fecha > hoy) {
alert('error');
obj.focus();
}
}
Las fechas tienes que estar en formato yyyy/mm/dd
Saludos,