What will trigger the validate() function? When you tab or switch the cursor to another textbox? This is what this does.
<html>
<head>
<title></title>
<script language="javascript">
function validate()
{
// Verify that both passwords put in match.
if ( ( document.getElementById("password").value != document.getElementById("passwordverify").value ) ||
document.getElementById("password").value.length == 0 )
{
alert("Both passwords must match.");
// return false;
}
}
</script>
</head>
<body>
<p align="center">To reset your password, provide your current password</p>
<form id="form1" name="form1" method="post" action="pcq.php">
<table border="0" align="center" class="mytable2" style="margin-left:175px" >
<tr>
<td>Current Password</td>
<td>
<input type="password" name="oldpass" style="width:150px;" />
</td>
</tr>
<tr>
<? $user=$_SESSION[myusername] ?>
<td><input type="hidden" name="usr" id="usr" value="<?php echo $user; ?>"style=" width:150px;" />
</td>
</tr>
<tr>
<td>New Password</td>
<td><input type="password" name="pass" style="width:150px;" id="password" /></td>
</tr>
<tr>
<td>Repeat New Password</td>
<td><input type="password" name="rpass" style="width:150px;" id="passwordverify" onblur="validate()"/></td>
</tr>
<tr>
<tr>
<td>
</td>
<td > <input type="submit" value="submit" >
<input type="reset" value="Reset"></td>
</tr>
</table>
</form>
</body>
</html>
samaru
a.k.a inscissor
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
Skill Endorsements: 21
Question Answered as of 3 Years Ago by
samaru What do you mean by "light box"?
samaru
a.k.a inscissor
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
Skill Endorsements: 21
users may submit without filling in either password input so
<form id="form1" name="form1" method="post" action="pcq.php" onsubmit='validate();'>
yes you can use a lightbox popup
instructions are in the lightbox docs,
RTFM
almostbob
Nearly a Senior Poster
3,280 posts since Jan 2009
Reputation Points: 585
Solved Threads: 398
Skill Endorsements: 7