May 21st, 2004, 07:49 AM
|
#1 (permalink)
| | Junior Member
Join Date: May 2004
Posts: 4
| web form selection javascript help
Greetings all, I am a really newbie to javascripting (I know very little about it, but I wish to learn)
This is what I hope to accomplish:
A form with three selection sections.
Section A: 4 selectionboxes that has an optionlist with 16 entries. If one is selected in the first box, that selection should not be available in the second selectionbox, and so on...
Section B: Two selectionboxes that gets their optionlist from the selections made in Section A, again: if one is selected, it should not be available in the next selectionbox.
Section C: One selectionbox that gets its optionlist from the two selections made in Section B.
Can someone lead me into the right path? |
| |
May 21st, 2004, 09:02 AM
|
#2 (permalink)
| | Kawaru wa yo!
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 16,137
|
Will the lists in the selection boxes be static, or be taken from a database?
Do you know how to make the list boxes already, or are you looking for someone to show you how to code the entire thing? |
| |
May 21st, 2004, 09:08 AM
|
#3 (permalink)
| | Junior Member
Join Date: May 2004
Posts: 4
|
The list in the first 4 selectionboxes should be static, could either come from an array or from a database... the two next selectionboxes should get its option values from the selections made in the first 4, and the last selectionbox should get its values from the two previous boxes... If I change in the first 4, the available selections for the other boxes should change...
but I know how to make a form and selectionboxes... what I am having problems with is to make a script that lets me get values from previous selectionboxes and put them as available selections
Last edited by elfranger : May 21st, 2004 at 09:10 AM.
|
| |
May 21st, 2004, 09:22 AM
|
#4 (permalink)
| | Kawaru wa yo!
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 16,137
|
Sounds like you need to make it event driven. When the user picks a selection in the first box, use the event, OnClick or whatever it is in JavaScript, and check to see which selection the user made. Then you can pull values in for the next box, and so on and so forth.
But are the selections in the second box going to change entirely based on what's selected in the first box, or is it going to be the same list, but you don't want them to make the same selectiont wice? |
| |
May 21st, 2004, 09:31 AM
|
#5 (permalink)
| | Junior Member
Join Date: May 2004
Posts: 4
|
selections should not change, no. The first 4 selections should be the source for the next two selections, and the two selections should be the source for the last selections...
Say you have a list of this:
Apple
Orange
Banana
Peach
Carrot
Chokolate
In the first four boxes you select from the entire list, and select: Apple, Carrot, Chokolate and Peach.
Below that, you have two new dropdown boxes. When you click the dropdown, you get Apple, Carrot, Chokolate and Peach to select from. You select Carrot and Chokolate.
Below taht again, you are presented with one dropdown list, and click it. You can now select from Carrot or Chokolate....
Am I making any sense?
Each dropdown section should be based on pervious selections... |
| |
May 21st, 2004, 10:50 AM
|
#6 (permalink)
| | Junior Member
Join Date: May 2004
Posts: 4
|
I am getting nowhere. I have been trying and trying.
Can someone helpe me out, just starting?
I can't even manage to populate a selectionbox from an array...
Maybe I should ask for someone to write me the script... or a small examplescript that I could look into... |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |