Hello, i was wondering if its possible to check the my value against an array?
Lets say I have 5 characters i dont want the user to have in the input field so instead of writeing like this:
[CODE=javascript]my_value.indexO f('first') == -1
my_value.indexO f('second') == -1
my_value.indexO f('3rd') == -1
my_value.indexO f('4th') == -1
my_value.indexO f('5th') == -1 and so on...
I would write like this:
var array_value = new Array("first", "second", "3rd", "4th" ,"5th");
value.indexOf(a rray_value) == -1[/CODE]
I tried that but couldnt get it to work, so is it possible to do this?
Lets say I have 5 characters i dont want the user to have in the input field so instead of writeing like this:
[CODE=javascript]my_value.indexO f('first') == -1
my_value.indexO f('second') == -1
my_value.indexO f('3rd') == -1
my_value.indexO f('4th') == -1
my_value.indexO f('5th') == -1 and so on...
I would write like this:
var array_value = new Array("first", "second", "3rd", "4th" ,"5th");
value.indexOf(a rray_value) == -1[/CODE]
I tried that but couldnt get it to work, so is it possible to do this?
Comment