| Javascript - Checking field value against an array
|
chris_f

msg:3015642 | 11:10 am on Jul 20, 2006 (gmt 0) | Hi All, I have an asp webform that other users can fill in. For one field in that form (call it 'z'). I have an array (call it 'y') which holds all the values 'z' cannot be and I have a function (call it 'f') which needs to be launched if the value of 'z' appears in 'y'. However, I am missing the bit that actually checks 'z' again the values in 'y' and launches 'f' if needed. I've done countless Google searches and come up with nothing. Can anyone help?
|
daveVk

msg:3015691 | 11:57 am on Jul 20, 2006 (gmt 0) | This what you mean? for ( var i=0; i<y.length; i++ } { if ( y[i]===myForm.z.value ) f(); }
|
chris_f

msg:3015718 | 12:26 pm on Jul 20, 2006 (gmt 0) | I'll give it a go and let you know. Thanks.
|
chris_f

msg:3015771 | 1:27 pm on Jul 20, 2006 (gmt 0) | It's working. I'm now tweaking :) Thanks
|
|
|