JQM (jQueryMobile) HTML5 Form Validation

Phill Pafford picture Phill Pafford · Apr 12, 2011 · Viewed 9.2k times · Source

I've found this h5validate plugin but having no luck with it when using it with jQM, anyone have any suggestions on html5 form validation w/ jQm?

I have multiple forms that need to be validated, which are also loaded via AJAX.

Here is the workflow:

  • Load main form, when page is loading bind with live() (this adds the jQM functionality).
  • On submission (which is a button click) load the next form via AJAX (The next form goes through the same logic on loading)
  • This is where I want to add the form validation, if valid submit and load the next form, else display errors

Need to add form validation for each form and wanted to take advantage of the html5 syntax, that's why I liked the h5validate plugin but everything I try nothing happens, ugh...

I've also looked at the jQuery Validation plugin but the additional syntax and markup is something I'm trying to avoid. And I've looked at HTML5FORM but it is using jQuery 1.4.2 and I'm using 1.5.x

Wanted to know if anyone else had any luck with html5 and multi form validation submission?

Answer

Cowwws picture Cowwws · Apr 13, 2011

I have had success with multi forms with the validationEngine.js plugin from here http://www.position-relative.net/creation/formValidator/

Example here: http://coww.ws/jqmtest/

Hope this helps?