Mega Code Archive

 
Categories / JavaScript DHTML / Event
 

Return boolean value for on click event

<html> <head> <title>A Simple Page</title> <script language="JavaScript"> function sendMe() {     return confirm("Continue?"); } function chkForm()      {     if (form1.textField.value == "")     {         alert("Please fill in the text box");         form1.textField.focus();         return false;     } } </script> </head> <body> <form name="form1" method="POST" action="youtCGI.cgi" onSubmit="return sendMe()"> <p><input type="text" name="textField"> <input type="submit" value="Submit" onClick="return chkForm()"> <input type="reset" value="Reset"></p> </form> </body> </html>