hi,
in my application i need to enter date nd time in the same textbox...if i run individually it is wrkng fine but wen i combine it is nt wrking fine...can anyone help me out
in my application i need to enter date nd time in the same textbox...if i run individually it is wrkng fine but wen i combine it is nt wrking fine...can anyone help me out
Code:
<script type="text/javascript">
function f(){
var re= /^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/;
var re1= /^(\d{2}):(\d{2}):(\d{2})/;
var el= document.getElementById('d');
var M= el.value.match(re);
var M1= e1.value.match(re1);
var msg= M+M1;
if (!msg) {
alert("correct");
}
else {
alert("wrong");}
}
</script>
</head>
<body>
<form id="form1" name="form1" action="index.php" onsubmit="return f()">
yyyy-mm-dd hh:mm:ss<input type="text" id="d"> <input type="submit" value="send me"></form>
</body>
</html>
Comment