I have a form with validation rendered by c# when the page is loaded, the rendered fields like so:
<input autocomplete="off" class="input-validation-error" data-val="true" data-val-number="The field Idade must be a number." data-val-range="message here" data-val-range-max="25" data-val-range-min="16" data-val-required="The Idade field is required." id="Content_MyFieldId" maxlength="3" name="Content.MyFieldId" value="0" type="text">
and I'm trying put a new html object equals the example with jQuery, but this new field is not validated when I submit the form.
Have a way to add validation in this field using jQuery?
PS: I don't want to use manual method like so:
$("#field").rules("add", {
required: true,
messages: {
required: "Required input"
}
});
Because I have the rules in the input field, I only want to apply it.