Hello I have been working for some time now to try and get this form set just the way I want.
I would like to validate each field. I have it set up with the exception of two parts. I don't know how to create the pattern for the field to compare against and I cannot get my password boxes to give an error when the confirm box is not the same as the password box. I have tried this two different methods to get this part to work with no success:
Method 1:
var password = document.getElementById('password');
var password_confirm = document.getElementById('password_confirm');
Question
Exodius06
Hello I have been working for some time now to try and get this form set just the way I want.
I would like to validate each field. I have it set up with the exception of two parts. I don't know how to create the pattern for the field to compare against and I cannot get my password boxes to give an error when the confirm box is not the same as the password box. I have tried this two different methods to get this part to work with no success:
Method 1:
var password = document.getElementById('password');
var password_confirm = document.getElementById('password_confirm');
if(password != password_confirm)
window.alert("The passwords do not match");
------------------------------------------------------------------------------------------------------------
Method 2:
if(document.getElementById('password') != document.getElementById('password_confirm'))
window.alert("The passwords do not match");
any help is appreciated.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts