Tried to get this to work:
var instance_name = $('#instance_name').val();
$("#instance_name").on("blur", function(e){
if (!~$.inArray(instance_name, not_allowed)) {
$("#instance_alert").html("<font color=green>Instance does not exists. Please continue</font>");
} else {
$("#instance_alert").html("<font color=red>Instance exists. Please try another one.</font>");
}
But to no avail.. (Looked into How to check if a value is NOT in an array using jQuery)
Any ideas why it still continues to say Please continue Kindly
.
you can use this: please $.inArray
if(jQuery.inArray("test", not_allowed) != -1) {
console.log("is in array");
} else {
console.log("is NOT in array");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With