Jump to content

Recommended Posts

Hi, This is a mix of Javascript and Ajax Question.

I have used the AJAX provided by an example on this site (the sticky note post)

and am altering it 2 work out if the 2 passwords provided by the user match, I was simply going to use if($password == $passwordcon){} for the PHP. However on the mainpage where the user inputs the code, the AJAX doesnt seem to be working. It appears to load the AJAX but then not save the password in the variable form, so when it is recalled it forgets it. To counter this I wanted the confirm password input, when onblur, to load the user input for Password, this is some form of Javascript but cant remember/figure it out. Here is the code:

Password: <div id="registercentre"><input type="text" name="password" id="password" onblur="javascript: MyAjaxRequest(\'main2\',\'ajaxfile.php?password=\',\'password\')" maxlength= "50" size="50" class="input1"></div><div id="help"><a href="#" onMouseover="fixedtooltip(\'Please Enter Your Password. This can be changed later.\', this, event, \'200px\')" onMouseout="delayhidetip()">[?]</a></div><br/>

Confirm Password: <div id="registercentre"><input type="text" name="passwordcon" id="passwordcon" onblur="javascript: MyAjaxRequest(\'main2\',\'ajaxfile.php?passwordcon=\',\'passwordcon\')" maxlength= "50" size="50" class="input1"></div><div id="main2"></div><div id="main3"></div><div id="help"><a href="#" onMouseover="fixedtooltip(\'Please Re-Enter Your Password. This can be changed later.\', this, event, \'200px\')" onMouseout="delayhidetip()">[?]</a></div><br/>

 

The AJAX is fine since I managed to get a username verifier working on the same page, however cant seem to get this to work. What I was considering changing to the Javascript was something like this:

Confirm Password: <div id="registercentre"><input type="text" name="passwordcon" id="passwordcon" onblur="javascript: MyAjaxRequest(\'main2\',\'ajaxfile.php?passwordcon=[color=red]&password=INPUTOFPASSWORD[/color]\',\'passwordcon\')" maxlength= "50" size="50" class="input1"></div><div id="main2"></div><div id="main3"></div><div id="help"><a href="#" onMouseover="fixedtooltip(\'Please Re-Enter Your Password. This can be changed later.\', this, event, \'200px\')" onMouseout="delayhidetip()">[?]</a></div><br/>

Help?!

Thanks

Rhys

Link to comment
https://forums.phpfreaks.com/topic/220846-ajax-password-verification/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.