xoxco/jQuery-Tags-Input — pull request #155 by Abhinaya (2013-10-31 07:21:17+00:00)
Title: Added beforeAddTag callback

This callback can be used for validating format of input/ any other actions to be done before adding tag.

Example:
inputElement.tagsInput({width: '100%', height: '20px, beforeAddTag: validateEmailAddress})

function validateEmailAddress(tag){
var emailRegex = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/;
if(!tag.val().match(emailRegex)){
tag.addClass("not_valid");
return false;
}else{
return true;
}
}