Different fields/text etc based on list item selection.
<b>Hi.</b><p> I'm a seasoned technical writer but I'm reasonably new to JavaScript and have spent several days trying to solve this problem.<p>
I've put together a page where I have a number of fields for user entry and two of the fields are linked lists. One MASTERand one SUB. Select from the master and the sub-list changes. These work well.<p>
I'm now trying to use the sub-list items to display different information/fields/check-boxes etc.. in an area below the list and this is where I'm having problems.<p>
I cannot work out how to make the displaying of this information conditional upon the sub-item selected and I'm hoping someone can give some clues.<p><b>Any help would be greatfully appreciated</b><p>TIA<p>
If I select AAAA, the second list shows only shows the options AAAA1, AAAA2, AAAA3 and selecting BBBB would show options BBBB1, BBBB2 et al.
This works OK through an array in the <head> area but now I am trying to go the next step.
I am trying to let the second list options determine a range of text and other fields that are displayed on the page.
For example:
If I select CCCC in the first list, the second list displays CCCC1, CCCC2, CCCC3 etc.. If I then click on (thereby selecting) say, CCCC3, a range of other information SPECIFIC to CCCC3 only is displayed on the page. This information will be a heading, some text and then some form fields and/or checkboxes.
Information specifically relating to CCCC1 and CCCC2 is NOT displayed at all as CCCC3 was selected.
So:
<List1>AAAA
BBBB
CCCC <SELECTED>
<List2>CCCC1
CCCC2
CCCC3 <SELECTED>
<NOT DISPLAYED>
Welcome to CCCC1. Enter your name [text field]
Are you Male [checkbox]
Female [checkbox]
<NOT DISPLAYED>
Welcome to CCCC2. Enter your name [text field]
Enter your address[text field]
<DISPLAYED>(because CCCC3 was selected above)
Welcome to CCCC3. Enter your name [text field]
Enter your height [text field]
Enter your weight [text field]
I hope my request is a bit clearer this time (my apologies for not being clear enough the first time).
ummm... Maybe you could do this by creating hidden divs for each of the options. When the visitor selects something from the list the div would become unhidden:
The DIVS are hidden but they don't 'unhide' when needed. If you can see the problem, please let me know. In the mean time, I'll try and work it out for myself (I'm reasonably new at this and its been a loooong day - so I'm hoping you can point out the obvious to me).
Bookmarks