homepage Welcome to WebmasterWorld Guest from 54.234.231.49
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library : Charter : Moderators: whoisgregg

JavaScript and AJAX Forum

    
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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved