I have a form which I would like to validate certain fields as being required as well as being digits. I'm having trouble figuring out how to apply both rules to said fields.
Currently here is how I am applying only the required rule, displaying the message in a span I have built into my form.
if (jQuery.validator) {
jQuery.validator.setDefaults({
errorPlacement: function (error, element) {
error.appendTo('#invalid-' + element.attr('id'));
}
});
}
$("#UserInputs").validate();
<label for="AvgGroupSize">Average Group Size:</label><br />
<span id="invalid-AvgGroupSize"></span>
<input type='text' id='AvgGroupSize' class='required' size='4' value='15'/> EEA's
How would I able to add a second validation rule (digits) to this field?
Thank you.
class='required digits'isn't working?