Oddish wrote:
I've got a bunch of radio buttons, all with the name "type" and all
with different id's (type1, type2 etc.), and for some reason the
validate plugin doesn't protest when I don't select a radio button,
and I don't get any javascript errors either. Here's the code:
$("#addForm").validate({
focusInvalid: false,
event: "blur",
rules: {
type: { required:true }
},
messages: {
type: "Please choose type"
}
});
-------------------------------------
And here's the html
<label for="type1">
<input type="radio" name="type" id="type1" value="1" />Type 1
</label>
<label for="type2">
<input type="radio" name="type" id="type2" value="2" />Type 2
</label>
-------------------------------------
Anyone got a clue?
There still is that positioning problem with radio buttons and
checkboxes. Currently you have two far-from-perfect options: Place the
error label for that group in the HTML (see the second example on the
demo page), or use the errorPlacement-option to override the default
positioning (insertAfter element, see custom-methods-demo).
In case the element is completely ignored and the form is submitted as
valid, there may be another problem. You should at least see an error
label inserted behind the first radio input. An example page of your
setup may help.
--
Jörn Zaefferer
http://bassistance.de