Back to the plugin

Validations

Please enter a list of email addresses:

Enter the valid email addresses



Source code

<html>
<script src="https://bossanova.uk/jsuites/v3/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jsuites/v3/jsuites.css" type="text/css" />

<p>Please enter a list of email addresses:</p>

<div id="tags"></div>

<p><input type='button' onclick='alert(tags.getValue())' value='  Get the value  '></p>

<script>
var tags = jSuites.tags(document.getElementById('tags'), {
    value: 'paul@jexcel.net,paul.hodel@gmail.com',
    validation: function(element, text, value) {
        if (! value) {
            value = text;
        }
        var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        var test = re.test(String(value).toLowerCase()) ? true : false;
        return test;
    }
});
</script>
</html>