Get form TextField value : Tag Reference : Document JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Document » Tag Reference »

 

Get form TextField value

















<HTML>

<HEAD>

<SCRIPT language="JavaScript">
<!--

function check_it()
{
   var thetext=document.myForm.the_time.value;
   if (thetext.indexOf("a"== -1)
   {
     window.alert("a should in between");
     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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Document
» Tag Reference