I know I am missing something very simplistic here, but I just can't figure it out.
I have a password field:
<INPUT TYPE="password" ID="password" NAME="password" VALUE="">
I also have a hidden field to hold the length of the password:
<INPUT TYPE="text" ID="password_length" NAME="password_length" VALUE="">
The reason I need to find the length of the password is because when the user clicks on the submit button, I convert the password into an MD5 hash before it is sent and I need to know if the password length before it is converted.
I could have a javascript detect the length and give an alert if it is under x characters, but since other error messages are displayed after the submission, I'd rather keep all error messages together.
To detect the length, here is what I was doing:
<INPUT TYPE="submit" NAME="submit" VALUE="Submit" onclick = "password_length.value = password.length">
When I submit and look at the tag (I use a value of $_POST[password_length]), the value is "undefined". What am I doing wrong?
I have a password field:
<INPUT TYPE="password" ID="password" NAME="password" VALUE="">
I also have a hidden field to hold the length of the password:
<INPUT TYPE="text" ID="password_length" NAME="password_length" VALUE="">
The reason I need to find the length of the password is because when the user clicks on the submit button, I convert the password into an MD5 hash before it is sent and I need to know if the password length before it is converted.
I could have a javascript detect the length and give an alert if it is under x characters, but since other error messages are displayed after the submission, I'd rather keep all error messages together.
To detect the length, here is what I was doing:
<INPUT TYPE="submit" NAME="submit" VALUE="Submit" onclick = "password_length.value = password.length">
When I submit and look at the tag (I use a value of $_POST[password_length]), the value is "undefined". What am I doing wrong?