Created
May 21, 2014 21:10
-
-
Save sidneiweber/c80a0dc39e52d753adbd to your computer and use it in GitHub Desktop.
Máscara de data com Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Mascara de datas < /title> | |
<script language="JavaScript" type="text/javascript"> | |
function mascaraData(campoData){ | |
var data = campoData.value; | |
if (data.length == 2){ | |
data = data + '/'; | |
document.forms[0].data.value = data; | |
return true; | |
} | |
if (data.length == 5){ | |
data = data + '/'; | |
document.forms[0].data.value = data; | |
return true; | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<form> | |
<input type="text" name="data" OnKeyUp="mascaraData(this);" maxlength="10" / > | |
</form> | |
</body> | |
< /html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment