Welcome to WebmasterWorld Guest from 54.198.196.102

Forum Moderators: open

Message Too Old, No Replies

JavaScript and Forms

data validations

     

LYZbeth

10:47 pm on Mar 7, 2002 (gmt 0)

Inactive Member
Account Expired

 
 


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!

11:55 pm on Mar 7, 2002 (gmt 0)

Full Member from GB 

10+ Year Member

joined:Oct 16, 2001
posts:201
votes: 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.