jeudi 21 octobre 2021

Pattern Tagify resource doesn't work for email validation

$(document).ready(function() { 
    $tags_input_val = $('#input_id').val();
    var $tags_input = $('#input_id').tagify($tags_input_val, {
        pattern: /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/,
        duplicate  : "already exists",
    });

I'm trying to validate emails input using those Tagify resources. The "duplicate" resource is working, but the pattern regex, that was supposed to mark the invalid emails with a different color isn't. I saw other solutions here, but they are using a different sintaxe...

Aucun commentaire:

Enregistrer un commentaire