Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 01-11-2006, 08:42 PM   #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?
Kulag is offline   Reply With Quote
Old 01-12-2006, 03:40 PM   #2
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
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:
<form>
<
input type="text" name="pass_field" id="pass" size="20">
</
form
Give that a try for your textfield.
__________________
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.
Force Flow is offline   Reply With Quote
Old 01-13-2006, 08:51 PM   #3
Member (7 bit)
 
Join Date: Sep 2004
Posts: 109
The code for my password fields is:
PHP Code:
<input type="password" name="pass" id="pass">
<
input type="password" id="verify"
I tried your method with no success.
Kulag is offline   Reply With Quote
Old 01-13-2006, 11:41 PM   #4
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
Hmm...

See if these help:

http://cs.wellesley.edu/~cs110/lectures/Verification/
http://www.codeave.com/javascript/code.asp?u_log=7051
http://www.echoecho.com/jsforms02.htm
http://www.quirksmode.org/js/forms.html
http://www.quirksmode.org/js/formex.html
Force Flow is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:03 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2