I'm using the jQuery Validation plug-in is it possible to trow the errors in a specific div? like
<label>userName:</label>
<input type="text" name="user"/>
<span id="userErr">you must enter username</span>
is this possible? 10x
I'm using the jQuery Validation plug-in is it possible to trow the errors in a specific div? like
<label>userName:</label>
<input type="text" name="user"/>
<span id="userErr">you must enter username</span>
is this possible? 10x
There are several ways to do this, as described by the documentation. You can use:
<label>userName:</label>
<input type="text" name="user"/>
<span class="userErr"></span>
errorPlacement: function(error, element) {
// error references a label element, element refers to the invalid element
element.next('.userErr').append(error);
},
or investigate errorElement
, wrapper
, and errorLabelContainer