You are on page 1of 1

<html>

<head>
<title>
FORM VALIDATION
</title>
<script type="text/javascript">
function validate()
{
if(document.form1.ex1.value=="")
{
alert("please enter your name")
return false
}
if(document.form1.ex2.value=="")
{
alert("please enter your password")
return false
}
return true
}
</script>

</head>
<body>
<form action=gg99.html form name=form1 onsubmit="validate()";>
Name <input type="text" name="ex1"> </br>
password <input type="password" name="ex2">

<input type="submit" value="click me">

</form>
</body>
</html>

You might also like