Need Help A Ajax Form

Discussion in 'Programming' started by gathersuccess, Dec 14, 2007.

  1. #1
    I got this code from W3schools.. but I still wondering and figuring out anyone may know how can I include more then one field to check at the same time..

    http://www.w3schools.com/ajax/ajax_source.asp

    they only show how to check one field.. anyone know any example what if I have 3 fields?

    like
    1. Username - Ajax to check if username is duplicate on database
    2. Email - Ajax to check email
    3. Password - Ajax to check password
     
    gathersuccess, Dec 14, 2007 IP
  2. B00MER

    B00MER Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Since they use an onkeyup javascript event handler you can't hook the existing function up to any other fields. I'd suggest moving it to the submit button or onblur event handler for each field, and rewrite the function to be more re-usuable. I'm assuming your using it for validations, if so I'd suggest checking out mootools or prototype.js as well...
     
    B00MER, Dec 20, 2007 IP
  3. gathersuccess

    gathersuccess Well-Known Member

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    #3
    Good day everyone
     
    gathersuccess, May 14, 2008 IP