homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

JavaScript and Forms
data validations

10+ Year Member

Msg#: 63 posted 10:47 pm on Mar 7, 2002 (gmt 0)

I'm trying to change a selction list according to selection on previous selection list. Does that make sense?
Here's what I have so far...
I have a feeling I'm making this a little too complicated.

function formatStrat(){
if (document.firstForm.Cornerstone.value==
<OPTION VALUE="1A">1A: Improve
<OPTION VALUE="1B">1B: Maintain
<OPTION VALUE="1C">1C: Maintan
<OPTION VALUE="1D">1D: Maintain Containment <OPTION VALUE="1E">1E: Maintain organization
<OPTION VALUE="1F">1F: Maintain and enhance }
else if(document.firstForm.Cornerstone.value==



<SELECT NAME="Cornerstone"
<OPTION VALUE="Safety">Safety
<OPTION VALUE="Personnel">Personnel
<OPTION VALUE="Performance">Performance <OPTION VALUE="Cost">Cost
OPTION VALUE="Culture">Culture

I hope this is enough info.
Thanks in advance!



10+ Year Member

Msg#: 63 posted 11:55 pm on Mar 7, 2002 (gmt 0)

Sometimes if I am using to many If Else statements then I switch to SELECT CASE.

The code looks cleaner and is easier to understand.

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