0
<html>

<head>
<script language="JavaScript">
function validator()
{
if (text_form.name.value == "")
{
   alert("Please enter your name"); 
   text_form.name.focus(); 
   return false;
}
return true;

}
</script>
</head>
<body>
<form name="text_form" method="get" action="success.html" onsubmit="validator()">
<label for="name"> Name </label>
    <input type="text" name="name"/> <br />
    <input type="submit" value="submit" />
    <input type="reset" value="reset" />
</form>
</body>

</html>



//whats wrong with my code? eventhough the validation is working, it still goes to the "success.html" helpp!! 


//thanks in advance..
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by iamjin04
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.