homepage Welcome to WebmasterWorld Guest from 54.211.219.178
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved