PDA

View Full Version : Password Verify


neilson
06-21-2006, 04:05 PM
I have this small javascript that checks to see if the two passwords match. Instead of an alert displaying if the passwords do not match, Id like it to display it on the screen. Anyone know how to modify it?

function CheckPasswords(form) {
Password = form.Password.value;
ConfirmPassword = form.ConfirmPassword.value;
if (Password != ConfirmPassword) {
alert ("New Password and Confirm Password do not Match.")
return false;
}
else return true;
}

Kravvitz
06-21-2006, 05:08 PM
Yes. Only ask questions with yes/no answers if you want "yes" or "no" as the answer. (http://bigredspark.com/answers.html)

I suggest you learn about the document object model, so that you can make such modifications yourself.
JavaScript tutorial - W3C DOM introduction (http://www.howtocreate.co.uk/tutorials/javascript/domintroduction)
http://www.quirksmode.org/dom/
http://www.quirksmode.org/js/dom.html
http://www.brainjar.com/
http://developer.apple.com/internet/webcontent/dom2i.html
http://www.mozilla.org/docs/dom/domref/dom_doc_ref.html
http://www.mozilla.org/docs/dom/domref/
http://www.w3schools.com/htmldom/dom_obj_document.asp
http://www.sitepoint.com/article/rough-guide-dom
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference
http://digital-web.com/articles/forms_usability_and_the_w3c_dom/
http://www.w3.org/DOM/