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

JavaScript and AJAX Forum

    
JavaScript and Forms
data validations
LYZbeth




msg:1471986
 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==
"Safety"
firstForm.strategy.options=={
<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==
"Personnel"

....}

then

<SELECT NAME="Cornerstone"
onChange="FormatStrat();">
<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!

 

justa




msg:1471987
 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