So basically i have an array with an child array which looks like this
var test = [['code', 'name'], ['code', 'name'], ['code', 'name'], ['code', 'name'], ['code', 'name']];
and i have an input. After clicking submit, i need to check if the input value is already in the array and if so, display error message.
I already tried using this code, but it doesn't work. It doesn't show up the error
var value = labelInput.val();
if(jQuery.inArray(value, test) !== -1) {
labelInput.addClass("sp-validation-error");
}