I’m just exploring the Validate plug-in for JQuery. During implementing in my webapp made with JQueryMobile I stumbled over the fact that validating such an element is not so simple like usual input-elements.
So the Question is: How to enable validation for select?
The trick consists out of two parts:
Validate is by default ignoring
:hidden. But that’s what JQM does with an<select>: hide it and placing a div-span-wrapper on top. Solution is to redefine the ignore-selector:To inform the user about the invalid field you have to show the error right on the wrapper:
And now in an working example:
That’s all folks!