ReactiveRaven / jqBootstrapValidation

A JQuery validation framework for bootstrap forms.
http://reactiveraven.github.io/jqBootstrapValidation
MIT License
1.35k stars 332 forks source link

non working email validation #172

Open AndreSchwarzer opened 9 years ago

AndreSchwarzer commented 9 years ago
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, ...

sromano88 commented 9 years ago

Same issue with a dummy@test.global address. It says is not a valid address.

sromano88 commented 9 years ago

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;
                                        }
                                    });
guipacheco2 commented 9 years ago

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'
        }
    }
});