0% found this document useful (0 votes)
15 views4 pages

WD Practical 6,7

practical wd

Uploaded by

harendra tomar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

WD Practical 6,7

practical wd

Uploaded by

harendra tomar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EXPERIMENT 6

PASSWORD VALIDATION
HTML CODE:

<html>

<head>

<title>PASSWORD VALIDATION</title>

<script language="javascript"> function pass()

var pw=f.pw.value; varcpw=f.cpw.value; if(pw.length<6)

alert("PASSWORD MUST BE 6 CHARACTERS"); } if(pw!=cpw

alert("PASSWORD DON'T MATCH");

else if(pw.length>=6)

alert("PASSWORD VALIDATION SUCCESS");

</script>

</head>

<body>

<form name="f">

<table align="center">

<h2 align="center"><u>PASSWORD VALIDATION</u></h2>

<br>

<tr>

<tdalign="right"><b>Password:</b></td>

<tdalign="left"><input type="Password" maxlength="10" size="30"name="pw"></td>

</tr>

<tr>

<tdalign="right"><b>Confirm Password:</b></td>
<td align="left"><input type="PassWord" maxlength="10" size="30"name="cpw"></td></tr>

<tr><td></td>

<td><input type="button" value="SUBMIT" onClick="pass()"/></td>

</tr>

</table>

</form>

</body>

</html>

OUTPUT:
EXPERIMENT 7
PHONE NUMBER VALIDATION
HTML CODE:

<html>

<head>

<title>PHONE NUMBER VALIDATION</title>

<script language="javascript"> functionphno()

{ varph=f.ph.value; if(ph.length==10)

{ if(isNaN(ph)) alert("It is not a valid Phone number"); else alert("It is a valid Phone number");

} else alert("Please enter a valid phone number");

</script>

</head>

<body bgcolor="lightgray">

<form name="f">

<table align="center"><br><br><br><br>

<h2 align="center"><u>PHONE NUMBER VALIDATION</u></h2> 3

<br>

<tr><tdalign="right">PHONE NO:</td>

<tdalign="left"><input type="text" maxlength="15" size="30"name="ph"></td>

</tr>

<tr><td></td>

<td><input type="button" value="SUBMIT" onClick="phno()"/>

</td>

</tr>

</table>

</form>

</body>

</html>
OUTPUT:

You might also like