I have a category dropdown selection element in my form. The form is validated with jQuery as follows:
$('#myForm').validate({
rules: {
text: {
required: true
},
category: {
required: true
}
},
messages: {
text: {
required: "Text required"
},
category: {
required: "Category required"
}
}
When loading the page, the default value of category is: '---' (without quotes). When I submit the form, the validation says eveything is ok, because '---' is not nothing. How can I get it to stop submitting when '---' is used as category? The other categories are something like this: Category1. One of the possibilities have to be choosen and I can't change the dropdown selection thing.
Thanks!!