Time Validate : Form Validation : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Form Validation »

 

Time Validate



<HTML>
<HEAD>
<SCRIPT language="JavaScript">
<!--
function check_it()
{
 var thetext=document.myForm.the_time.value;
 if (thetext.indexOf(":"== -1) {
      window.alert("Sorry, the time needs to have a colon (:) to be valid. Try again.");
      return false;
 else {
     return true;
 }
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM name="myForm" action="#" onSubmit="return check_it();">
What time is it?<BR>
<INPUT type="text" name="the_time">
<BR>
<INPUT type="submit" value="Submit">
</BODY>

</HTML>
           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Form Validation