Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • anthony hall 222 posts 536 karma points
    May 10, 2013 @ 13:03
    anthony hall
    0

    Adding custom validation rules to unobtrusive.min.js

    I've been trying to add custom validation to contour.js


    here is my input field with the 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 my custom rules in contour.js. My issue is that it is not firing

     

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

     

Please Sign in or register to post replies

Write your reply to:

Draft