JuniorBee
asked on
Compare 2 fields before submitting
How can I compare two fields to be sure they are the same onclick? These are password fields and I did not want to have to submit the form to compare them if I can do it this way instead.
=)
=)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The best approach would be to use both forms of validation: Server-side and Client-side. Client-side validation usually makes the site easier for your users.
I would recommend using Server-side validation 100% of the time (since it cannot be turned off like Client-side validation can) and adding Client-side validation (javascript) where you both think it is appropriate and have the time desire and code it.
-Dan
I would recommend using Server-side validation 100% of the time (since it cannot be turned off like Client-side validation can) and adding Client-side validation (javascript) where you both think it is appropriate and have the time desire and code it.
-Dan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Anybody got any client side pw validation script? One for onclick?
ASKER
Ack, you musta hit sumbit just before me eh?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yep :)
So, is that the kind of code you were looking for?
So, is that the kind of code you were looking for?
Looks good dan. Also it is intuitive, by checking two conditions, if the first is blank, (no need to check the second given that your second check is), if the two are equal or unequal.
Joe P
Joe P
ASKER
Thanks a bunch! I awarded the points according to the question I asked although it was all so very helpful!!!
ASKER
For my info, how do I completely disable the javascript in my browser (IE6) so that I can test any security holes in my code. That would be helpful too! Then I can see what needs to be in ASP and what's OK to leave in Javascript.