Link to home
Start Free TrialLog in
Avatar of jagku
jagkuFlag for United States of America

asked on

jQuery validate email address against db when focus is moved

Hello Experts,

I am looking for someone to point me in the right direction with this scenerio.
What I have is a register user form where the user types in their email address.
As soon as they tab/move away from the email address text box, I want some jQuery to compare what the user has typed against my db (by calling some php code and passing in their email address). The php would return true or false (or 0 or 1 etc) - which the jQuery would then display as a success or failure (using the relevant icons).

Does this make sense?

Many Thanks
ASKER CERTIFIED SOLUTION
Avatar of moagrius
moagrius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
forgot an 'else' at the end of the php...  all the the above is untested and might have syntax errors but should generally demonstrate the idea, which is about as much as is possible without details regarding the db, the selectors of the input, etc...
Avatar of pius_babbun
pius_babbun

I suggest you can go in for ajax form submission

http://mazesolutions.me/ajax/ajax-login-form-php-javascript

http://mazesolutions.me/demos/ajax2/

just check if this is helpful to you !