Sanada
Newbie
- Joined
- Aug 28, 2004
- Messages
- 504
- Reaction score
- 0
I'm hoping there're some JavaScripts pros here that can help me with this problem.
I have an array on strings that look something like this:
This array contains reference numbers and would, in time, become very big. The data for the array is extracted from a SQL database using PHP code. This is what it looks like in the generated web file file.
What I'd like to do now is use an onChange event on a input text field to trigger a function that creates a pop up a alert message if the 9-digit number entered matches one in the array. So, if I enetered the number "107348556", a alert message should appear. I've tried various code snippets from the web but none work. I usually end up getting a "Object expected" error in the debug window in IE (I have tested in 3 other browsers and get the same thing).
I have an array on strings that look something like this:
Code:
var ref_array = new Array();
ref_array[0] = "107348556";
ref_array[1] = "107999024";
ref_array[2] = "143687952";
ref_array[3] = "102487924";
This array contains reference numbers and would, in time, become very big. The data for the array is extracted from a SQL database using PHP code. This is what it looks like in the generated web file file.
What I'd like to do now is use an onChange event on a input text field to trigger a function that creates a pop up a alert message if the 9-digit number entered matches one in the array. So, if I enetered the number "107348556", a alert message should appear. I've tried various code snippets from the web but none work. I usually end up getting a "Object expected" error in the debug window in IE (I have tested in 3 other browsers and get the same thing).