I've been trying for the past week to put a simple code together. I
have done a LOT of searching, found scripts showing the functions I
would like to use, however when I mix them it all goes wrong, somehow
I always end up with error messages and functions not working right.
Can someone please help me?
I have a form, inside is 1 Text Field and 2 Password Fields. What I'm
looking to do is:
- Make sure password fields are equal
- Set Minimum/Maximum amount of characters in each field
- Disable submit button after clicking submit
I plan to add more text fields in the future. Will I be able to? I
know how to add it in the form, but how do I change the script?
Any help is appreciated. What I have so far may not be worth a look,
it's not even working, I don't know why, but here is goes:
<html>
<head>
<title>Test Page 01</title>
<script language="JavaS cript">
<!--
function checkPw(element ) {
pw1 = document.FormNa me.pw1.value;
pw2 = element.value;
if (pw1 != pw2) {
alert ("Passwords do not match. Please re-enter.");
document.FormNa me.pw1.value="" ;
document.FormNa me.pw2.value="" ;
document.FormNa me.pw1.focus();
return false;
}
}
// -->
</script>
</head>
<body>
<form action="http://www.photoshelf. net/cgi-bin/mailto"
onsubmit="retur n FrontPage_Form1 _Validator(this )" method="post"
name="FormName" >
<input type="hidden" name="THANKURL"
value="http://www.somepage.or g/ok.htm">
<input type="hidden" name="RECIPIENT " value="someone@ somepage.com">
<input type="text" name="UserName" size="20" maxlength="60">
<input type="password" name="pw1" size="20" maxlength="60">
<input type="password" name="pw2" size="20" maxlength="60"
onBlur="checkPw (this)"><br>
<input type="submit" value="Submit Application" onClick="if(thi s.value
== 'Continue') this.form.submi t();">
</form>
</body>
</html>
Thanks. Mike
have done a LOT of searching, found scripts showing the functions I
would like to use, however when I mix them it all goes wrong, somehow
I always end up with error messages and functions not working right.
Can someone please help me?
I have a form, inside is 1 Text Field and 2 Password Fields. What I'm
looking to do is:
- Make sure password fields are equal
- Set Minimum/Maximum amount of characters in each field
- Disable submit button after clicking submit
I plan to add more text fields in the future. Will I be able to? I
know how to add it in the form, but how do I change the script?
Any help is appreciated. What I have so far may not be worth a look,
it's not even working, I don't know why, but here is goes:
<html>
<head>
<title>Test Page 01</title>
<script language="JavaS cript">
<!--
function checkPw(element ) {
pw1 = document.FormNa me.pw1.value;
pw2 = element.value;
if (pw1 != pw2) {
alert ("Passwords do not match. Please re-enter.");
document.FormNa me.pw1.value="" ;
document.FormNa me.pw2.value="" ;
document.FormNa me.pw1.focus();
return false;
}
}
// -->
</script>
</head>
<body>
<form action="http://www.photoshelf. net/cgi-bin/mailto"
onsubmit="retur n FrontPage_Form1 _Validator(this )" method="post"
name="FormName" >
<input type="hidden" name="THANKURL"
value="http://www.somepage.or g/ok.htm">
<input type="hidden" name="RECIPIENT " value="someone@ somepage.com">
<input type="text" name="UserName" size="20" maxlength="60">
<input type="password" name="pw1" size="20" maxlength="60">
<input type="password" name="pw2" size="20" maxlength="60"
onBlur="checkPw (this)"><br>
<input type="submit" value="Submit Application" onClick="if(thi s.value
== 'Continue') this.form.submi t();">
</form>
</body>
</html>
Thanks. Mike
Comment