|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (7 bit)
Join Date: Sep 2004
Posts: 109
|
"pass has no properties"
This is the error I get when running the following code.
var pass=document.getElementById("pass"); var verify=document.getElementById("verify"); function register() { if (pass.value==verify.value) { actx("register"); } else { window.alert("Error! Password is not the same in both the password and the password verification fields!"); } } The pass and verify fields are both of type "password". Can someone tell me what I did wrong here? |
|
|
|
|
|
#2 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
var pass=document.getElementById("pass");
When you call this, you're actually grabing the value of whatever is in the element with the ID "pass", not with the name "pass" PHP Code:
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
|
|
|
|
|
|
#3 |
|
Member (7 bit)
Join Date: Sep 2004
Posts: 109
|
The code for my password fields is:
PHP Code:
|
|
|
|
|
|
#4 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|