jQuery Mobile Form Validation - Which Plugin to choose?
Which framework would you choose to validate forms in a jQuery Mobile app? In addition my webapp runs in the PhoneGap native wrapper on iPhone and Android.
There are numerous jQuery form validation frameworks out there - but from your experience what works well with the mobile v开发者_StackOverflowersion of jQuery?
Criteria that would be interesting in the mobile context:
- touch-enabled notification messages - in case of wrong validation the message is ideally optimized for small screen estate
- message in place with the wrong form field
- offline functionality - since the PhoneGap app runs occasionally without network access
try this one: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ it worked pretty neatly for me,
I'll second the vote for the validation plugin. It shouldn't have any conflict with jqMobile since it simply works on the submit() action. Basically it intercepts the submit and applies a series of rules to check the form. You can have custom rules, custom error locations, etc. About the only thing I've had trouble with is using it with a class of fields. It pretty much wants individual names/IDs to validate.
I'm currently trying to use that plugin with JQM 1.2 and it breaks form submission handling. when i enable the plugin and submit a form successfully, the browser takes me to the action.php file that was specified in the form. when i disable the plugin, the form submits and the returned html is displayed properly via ajax and the .php file is properly never shown. so i don't think this plugin is great for JQM...
精彩评论