jquery - Adding custom validation rules to unobtrusive.min.js -


i've been trying add custom

here input field attribute data-val-matchemail

<input type="text" name="5621755b-8bab-4a19-8c68-bf35860062fe" id="5621755b-8bab-4a19-8c68-bf35860062fe" class="text" value="" data-val-matchemail="email" maxlength="500"> 

and custom rules in contour.js. issue is not firing

$.validator.addmethod('contour_matchemail', function (value, element) {     console.log("contour_matchemail");     return valid; });  $.validator.unobtrusive.adapters.addbool("matchemail", "contour_matchemail"); 

instead of

$.validator.unobtrusive.adapters.addbool(.... 

perhaps try this:

$('#your_form_id').validate(); $('#5621755b-8bab-4a19-8c68-bf35860062fe').rules('add', 'contour_matchemail'); 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -