Password Confirmation Form

Solved
Nowhere Man Posted messages 319 Status Membre -  
Nowhere Man Posted messages 319 Status Membre -
Good evening,
I am trying to create a member area for my site, and for that in the registration form I am asking for a password, I would like to introduce another password field as a confirmation of the previous one. Should I create a condition in JavaScript with "onSubmit" in the <form> tag like this?

<form method="post" action="index.php?id=confirm_inscription" onSubmit='if (this.password.value != this.password_confirm.value) {return false ;}'>


With:
<p>Password :<br /> <input name="password" type="password" size="50" /><br /> Password (confirmation) :<br /> <input name="password_confirm" type="password" size="50" /> </p><hr />


If this method works, nothing happens when submitting the form, how can I create an alert if the passwords are different?

Thank you in advance.
--

___ ToOiinou.
Configuration: Windows Seven Firefox 3.0.6
</form>

2 réponses

bissdebrazza Posted messages 2886 Status Contributeur 712
 
Hi!
Why put the password verification in a separate form? You could have everything in the same form and check both passwords to see if they match or not!
--
"One must have learned a great deal in order to know how to ask for what one does not know."
Jean-Jacques ROUSSEAU
3