1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
function TestDate(){
var inDate = document.getElementById("date_realisation1").value;
var Expression = new RegExp("^[0-9]{2}/{1}[0-9]{2}/{1}[0-9]{4}$","gi")
if (Expression.test(inDate))
alert("Format OK.")
else
alert("Entrez une date au format jj/mm/aaaa")
}
//-->
</script>
</head>
<body>
<input type="text" id="date_realisation1" size="10" value = "jj/mm/aaaa">
<input type="button" value="Bouton" onclick="TestDate()">
</body>
</html> |