jqBootstrapValidation icon indicating copy to clipboard operation
jqBootstrapValidation copied to clipboard

non working email validation

Open AndreSchwarzer opened this issue 11 years ago • 3 comments

validemail: {
                name: "Validemail",
                type: "regex",
                regex: "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\.[A-Za-z]{2,4}",
                message: "Not a valid email address<!-- data-validator-validemail-message to override -->"
            },

your regex doesn't support TLDs like .travel, .solution, . expert, ...

AndreSchwarzer avatar Nov 23 '14 12:11 AndreSchwarzer

Same issue with a [email protected] address. It says is not a valid address.

sromano88 avatar Jan 23 '15 09:01 sromano88

This is what I did as a workaround till validation gets fixed.

    $("input").not("[type=submit]").jqBootstrapValidation({
                                        filter: function () {
                                            if($(this).attr('type') == 'email')
                                                    return false;
                                            return true;
                                        }
                                    });

sromano88 avatar Jan 23 '15 11:01 sromano88

Another workaround is override the default function, like:

$.jqBootstrapValidation('override', {
    builtInValidators: {
        validemail: {
            name: 'Validemail',
            type: 'regex',
            regex: '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\.[A-Za-z]{2,6}',
            message: 'Not a valid email address'
        }
    }
});

guipacheco2 avatar Jul 27 '15 14:07 guipacheco2