Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2004
    Posts
    158
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Query MySQL on Form Field input

    Not sure if this is a question for the PHP or MySQL forum.

    Anyhow, we have a submission form where the user enters details to create a profile of sorts. We only want to allow one profile per email address however our client does not want the user to enter all of their user details and then after submitting the form, get the message that they already have an account with the email address.

    Our client has asked us to add the functionality that once an email address is added to the field, that it queries the database at that point to make sure there isn't another account with the same email address.

    Our question is what would be involved to add this type of functionality, basically on text input/onchange?

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    That would be Ajax that you would use, and I would suggest using the jQuery library to do the ajax call. There is actually a jQuery plugin that makes this kind of thing rather simple. In fact there are several plugins, but here's a pretty straight-forward one:

    http://plugins.jquery.com/project/smartform

    jQuery is awesome!

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Posts
    158
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Fumigator,

    A few questions.

    1. Does anything need to be installed on the server (PHP modules, etc) for Ajax and jQuery to work?

    2. Do you have any sample code that would accomplish what we are looking for? We would pay for your time to write the sample code if you don't have it already.

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Quote Originally Posted by keith1995 View Post
    Fumigator,

    A few questions.

    1. Does anything need to be installed on the server (PHP modules, etc) for Ajax and jQuery to work?

    2. Do you have any sample code that would accomplish what we are looking for? We would pay for your time to write the sample code if you don't have it already.
    #1-- Ajax is a technology that gives you the ability to "sneak" out of a page to grab data or whatever, and "sneak" back in without the page requiring a reload. So there is a server side to the process, but it's no different than a normal server side process-- meaning, you just plop a PHP script out there that is written to handle the Ajax call.

    #2-- I know what you mean. I was rather intimidated by Ajax as well as jQuery when I first dove in. But I assure you, the jQuery website has excellent documentation, and lots of examples. I can't say much about the community-- I've never gotten any help from anyone on that worthless google group. Too bad CodingForum's jQuery forum isn't more popular. But for me to write just an example would be a waste of time, as there are tons of examples and tutorials already written and are just a google away. (Now... if you want to hire me to do some freelance work for you, that's another story... PM me )


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •