I need to be able to check for an exact match in my list using jQuery.
I need to be able to tell if it an exact match exists, not if a sub-string match exists.
if ($('.validValuesListMain ul li:contains('+val+')').length ) {
notImportedCount++;
} else {
importCount++;
$('.validValuesListMain ul').append('<span class="deleteValid" title="Delete Autofix">X</span><li class="validTag">'+val+'</li>');
}
Process Flow
For example when a user types in 'John Doe' if 'John Doe' does exist, then error. If a user types 'John Doe' and in the list there is 'John Do' then this is okay as it's not an exact match.
Pseudo Code
If (John Doe) not exact match (John Do) {
alert('no duplicates found');
} else {
alert('duplicates found');
}