The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help verifying that passwords match
tyler.watkins
post Apr 9 2012, 06:28 PM
Post #1


Novice
**

Group: Members
Posts: 27
Joined: 6-March 12
Member No.: 16,654



I am working on a website and I am trying to make a registration page and a members login. I am fairly new to coding and I really enjoy it. The question i have now is how do i verify that both passwords match on the registration page. Like when they go to sign up, the password and the confirm password fields match.

the page I am having the trouble on is: http://blocks.netne.net/register.html

Also please have a look around the site and see if you have any suggestions for me.

I realize that my coding might not be the best.

Also if you have any suggestions or if you could help me with setting up the whole login system, please reply or pm me.

Thanks in advance!!!

PS I am not really sure if this is the right place for this topic.

This post has been edited by tyler.watkins: Apr 9 2012, 06:29 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Apr 9 2012, 07:10 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Ultimately, you need to verify that the passwords match in the server-side program that processes the form data (reg3.php).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
tyler.watkins
post Apr 9 2012, 07:56 PM
Post #3


Novice
**

Group: Members
Posts: 27
Joined: 6-March 12
Member No.: 16,654



How would I do that? Any idea how the code will look?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Enhanced Software Solutions
post May 8 2012, 04:31 AM
Post #4


Newbie
*

Group: Members
Posts: 12
Joined: 22-March 12
From: Tenali
Member No.: 16,762



QUOTE(tyler.watkins @ Apr 9 2012, 07:56 PM) *

How would I do that? Any idea how the code will look?


U can use the following java script function for comparing password and confirm password

CODE

<script type="text/javascript" language="JavaScript">

function checkPassword(theForm)
{
    if (theForm.password.value != theForm.verify.value)
    {
        alert('Passwords are not same');
        document.getElementById("verify").focus();
        return false;
    } else {
        return true;
    }
}

</script>

And call this javascript function on submit
<form action="../" onsubmit="return checkPassword(this);">


</form>


Hope this will help you. smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post May 8 2012, 11:37 AM
Post #5


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



But keep in mind that you need the same check in the PHP, after the data has been submitted to the server.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 10:41 AM