SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having trouble getting my head around this ajax issue - please help.

    Ok, so I have a field that I would like to validate using ajax by i am struggling with how to make it work, here is the scenario I am worried about.

    User changes the value in field and then clicks directly on the submit button. Essentially the submit process and the field validation are called at the same time. So how do I intercede to prevent the submit function from firing before the validation comes back?

  2. #2
    SitePoint Zealot the DtTvB's Avatar
    Join Date
    Jul 2006
    Location
    Thailand
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On the `onsubmit` function, just create an AJAX request and just `return false`.

    When the data arrives, you can check them and then `form.submit()` if it passes..


Bookmarks

Posting Permissions

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