form-submit

a link

notes

There are five common ways to submit an HTML form to the server:

  1. <input type="submit" ... />
  2. <input type="button" ... />
  3. <input type="image" ... />
  4. <button ... />
  5. <a ... />

There are four different ways to script events against these elements in order to POST the form properly while still including some kind of client-side validation:

  1. link your validate method to the form (works for #1 above)
  2. link your validate method to the click-able element (works for #2 and #2 above)
  3. link your validate method to a function that executes the validate method and, if valid executes the submit method of the form (works for #4 above)
  4. link your validate method to a function that executes the validate method and, if valid executes the submit method of the form *and* then return false; every time (works for #5 above)

Do a view source on this page to see the javascript details that illustrate each of the above options. For a bit more description of this page, check out form-submit soup.

Mike Amundsen