Validation in HTML Form :: How to Apply Validation in Html Form
<html>
<head>
<title>Validation </title>
<script language="javascript">
function validate1()
{
if(myfrm.txtuname.value=="")
{
alert("Please Enter Username.. ");
}
else if(myfrm.txtpass.value=="")
{
alert("Please Enter Password.. ");
}
else
{
alert("Login Successfully.. ");
}
}
</script>
</head>
<body>
<form name="myfrm"> <table width="35%"> <tr>
<td> User Name : </td>
<td> <input type="text" name="txtuname"> </td>
</tr>
<tr>
<td> Password : </td>
<td> <input type="password" name="txtpass" maxlength="8"> </td>
</tr>
<tr>
<td> </td>
<td> <input type="submit" value=" Log in " onclick="validate1();"> <input type="reset" value=" Cancel ">
</td>
</tr>
</table>
</form>
</body>
</html>
<head>
<title>Validation </title>
<script language="javascript">
function validate1()
{
if(myfrm.txtuname.value=="")
{
alert("Please Enter Username.. ");
}
else if(myfrm.txtpass.value=="")
{
alert("Please Enter Password.. ");
}
else
{
alert("Login Successfully.. ");
}
}
</script>
</head>
<body>
<form name="myfrm"> <table width="35%"> <tr>
<td> User Name : </td>
<td> <input type="text" name="txtuname"> </td>
</tr>
<tr>
<td> Password : </td>
<td> <input type="password" name="txtpass" maxlength="8"> </td>
</tr>
<tr>
<td> </td>
<td> <input type="submit" value=" Log in " onclick="validate1();"> <input type="reset" value=" Cancel ">
</td>
</tr>
</table>
</form>
</body>
</html>
Validation in HTML Form :: How to Apply Validation in Html Form
Reviewed by Unknown
on
7:37:00 PM
Rating:
html codings to learn web design
ReplyDeletehtml codes | Single paragraph in body