Follow us on Facebook
<html>
<head>
<script language="javascript" type="text/javascript">
function validateForm()
{
var result = true;
var msg="";
if (document.form.Username.value=="")
{
msg+="You must enter your Username \n";
document.form.Username.focus();
document.getElementById('Username').style.color="red";
result = false;
}
if (document.form.Password.value=="")
{
msg+="You must enter the Password \n";
document.form.Password.focus();
document.getElementById('Password').style.color="red";
result = false;
}
if (document.form.Email.value=="")
{
msg+="You must enter the Email \n";
document.form.Email.focus();
document.getElementById('Email').style.color="red";
result = false;
}
if(msg=="")
{
return result;
}
{
alert(msg)
return result;
}
}
</script>
</head>
<body>
<h1>Account Setup Page</h1>
<form name="form" method="post" action="success.html">
<table width="50%" border="0">
<tr>
<td id="Username">Username</td>
<td><input type="text" name="Username" /></td>
</tr>
<tr>
<td id="Password">Password</td>
<td><input type="text" name="Password" /></td>
</tr>
<tr>
<td id="Email">Email</td>
<td><input type="text" name="Email" /></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit" onClick="return validateForm();" /></td>
<td><input type="reset" name="Reset" value="Reset" /></td>
</tr>
</table>
</form>
</body>
</html>
<html>
<head>
<script language="javascript" type="text/javascript">
function validateForm()
{
var result = true;
var msg="";
if (document.form.Username.value=="")
{
msg+="You must enter your Username \n";
document.form.Username.focus();
document.getElementById('Username').style.color="red";
result = false;
}
if (document.form.Password.value=="")
{
msg+="You must enter the Password \n";
document.form.Password.focus();
document.getElementById('Password').style.color="red";
result = false;
}
if (document.form.Email.value=="")
{
msg+="You must enter the Email \n";
document.form.Email.focus();
document.getElementById('Email').style.color="red";
result = false;
}
if(msg=="")
{
return result;
}
{
alert(msg)
return result;
}
}
</script>
</head>
<body>
<h1>Account Setup Page</h1>
<form name="form" method="post" action="success.html">
<table width="50%" border="0">
<tr>
<td id="Username">Username</td>
<td><input type="text" name="Username" /></td>
</tr>
<tr>
<td id="Password">Password</td>
<td><input type="text" name="Password" /></td>
</tr>
<tr>
<td id="Email">Email</td>
<td><input type="text" name="Email" /></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit" onClick="return validateForm();" /></td>
<td><input type="reset" name="Reset" value="Reset" /></td>
</tr>
</table>
</form>
</body>
</html>
0 comments:
Post a Comment