I have an array of characters like :
var invalid_chars = ['<', '>', '$', '@', '&', '+', '(', ')', '[', ']', '{', '}',' ','`'];
and have a string like :
var id_val = $("#id_number").val(); //text field contains "mu 1$2@345"
So I want to restrict the invalid_chars to be entered in the filed.
For that I have the following code:
var id_val = $("#id_number").val();
var invalid_chars = ['<', '>', '$', '@', '&', '+', '(', ')', '[', ']', '{', '}',' ','`'];
if (in_array(invalid_chars,id_val)) {
console.info("HI");
}
But it shows me error."ReferenceError: in_array is not defined"
Please help me out. Thanks in advance.