Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Pessoal peguei essa função aqui mesmo no site do Imasters, mas não estou cinseguindo fazer funcionar !
Será que alguem faz alguma idéia do que estou fazendo errado !
<html><head><title>TESTE</title><script language="JavaScript"><!--function fmtDate(campo, e) { myVal = campo.value; if (myVal.length > 2 && !myVal.match(/\//)) { myVal = ''; } else { if (window.event) { keycode = window.event.keyCode; } else if (e) { keycode = e.which; } if (keycode < 48 || keycode > 57) { myVal = myVal.substr(0, (myVal.length - 1)); } if (myVal.length == 2 || myVal.length.length == 5) { myVal += '/'; } } campo.value = myVal; }//--></script></head><body><form name="form1" method="post" action=""><input type="text" name="data" size="11" maxlength="10" onKeyUp="fmtDate(this, e);"></form></body></html>
Carregando comentários...