|
| |
|
|
Jason23
Posts: 5 Joined: 12/11/2001 From: Status: offline
|
Dynamic Drop-Down List - 3/11/2004 21:19:32
How do I make a dynamic dropdown list? I need 4 drop down boxes all dependent on on another and the last drop down box will redirect to a specific page for that particular selection. This type of script is new to me and don't even know where to begin. Any help is greatly appreciated! Thanks.
|
|
|
|
Richard Dudley
Posts: 668 Joined: 8/22/2002 From: Butler, PA Status: offline
|
RE: Dynamic Drop-Down List - 3/11/2004 21:49:06
This is not a simple task. There are a couple of ways to approach the task, though. The first way is to have the form submit to itself when the option is changed. When the form submits to itself, the form handler checks for the selection, and reads the next values from a database. This is actually the easier of the two methods, but it will require 4 round trips to the server, which can get time consuming. A second way is to store every option in javascript variables. When a selection is made, a javascript fires that reads the selected value, and loads the next values based on that selection. I have just completed a very complicated form using this methd. The advantage is that it is nearly instantaneous to your users. But it's a real challenge for you. First thing to decide is do you want the hard way that's better for your users, or the easy way that's a pain for the users? There's a hybrid method I'm working on, but it's not done yet, so I can't provide any bit of assistance on it yet. Once you figure out which way you want to go, I can give you some more direction.
_____________________________
I need to change my avatar--the puppy is full grown now!
|
|
|
|
Jason23
Posts: 5 Joined: 12/11/2001 From: Status: offline
|
RE: Dynamic Drop-Down List - 3/11/2004 22:25:26
This isn't looking good! lol....I can't afford to take the time it takes to code using the java method but it would be nice to make the form as easy as possible for the user. I looked at a sample javascript code for a 2 drop down list function and I could see the coding could get very detailed and take a long time to get the form to work the way I need it. What is all involved in the database version? I'm thinking this might be my best option since I need to program this asap. Thanks for your help!
< Message edited by Jason23 -- 3/11/2004 22:26:20 >
|
|
|
|
AMysticWeb
Posts: 855 Joined: 10/23/2002 Status: offline
|
RE: Dynamic Drop-Down List - 3/12/2004 4:05:16
Hi Jason23, There is a Triple Menu Script available. I have yet to find a quadruple script however. I use it for my site navigation. I am not good at coding and it took me a while to set it up. It is basically a duplication process to add options, but I am not good at following directions. Although my menu works, I have still been too lazy to finish it up. From the sounds of it, you might have greater overall success with Richard's method.
< Message edited by AMysticWeb -- 3/12/2004 4:06:08 >
_____________________________
Hope I have been of some help, Micheal [URL=http://web.archive.org/web/20060101013129/http://www.frontpageforms.com/]FrontPageForms.com-Archive Version[/URL] I am living Proof that Viral Procrastination exists!
|
|
|
|
Richard Dudley
Posts: 668 Joined: 8/22/2002 From: Butler, PA Status: offline
|
RE: Dynamic Drop-Down List - 3/12/2004 8:11:14
I'm assuming that for this example, the values in box 2 rely only on the selected value in box 1, and the values in box 3 correspond only to the value in box 2, and the values in box 4 rely only on the selected value in box 3 (the example I just finished did not, and was a little more complicated). I'm also doing this off the cuff, so some parts may need a little clarification later. For your database, you need to set up tables containing the values for box 2, 3 and 4 (hard code box 1 unless it will change often). The table should have three columns--parent value, value, and text. Each select box will fire a small javascript in the onChange event. Something like onChange="fncFillNext(this.id)". The javascript function will basically submit this form to itself. This is one of those parts that will require some elaboration. A form handler on the page reads the value of what box was selected (from this.id), and what the selected value is, and retrieves the values of the next box from the database. This information is used to populate the select box. It's a little simpler, but requires four loads of the page.
_____________________________
I need to change my avatar--the puppy is full grown now!
|
|
|
|
LoriL1212
Posts: 394 Joined: 1/30/2004 From: South Florida Status: offline
|
RE: Dynamic Drop-Down List - 3/12/2004 16:55:58
I can help you here... Are you looking for a "dropdown menu" - like at http://www.seaspecialties.com/ Or are you looking for a "form field on select" script?
< Message edited by LoriL1212 -- 3/12/2004 16:59:40 >
_____________________________
Lori Leach :: zenful creations :: kudos :: musings
|
|
|
|
Jason23
Posts: 5 Joined: 12/11/2001 From: Status: offline
|
RE: Dynamic Drop-Down List - 3/12/2004 18:42:22
Richard: Yes, you are correct. Each box relies on what data was selected in the previous box. I am going to setup a database and try coding the drop down boxes from that dbase. I am sure more questions will come after I get started! Thanks. LoriL1212: I need a form that has 4 drop down text boxes that relies on one another. For example the first drop down box has 3 selections (A, B, C) if I select B then the second drop down box pulls 3 more selections that are directly related to my selection from the first box., and so on. Maybe the term for this type of script is the "form field on select" script. I am not sure. AMysticWeb: Is that script you are referring to a dbase driven script or javascript? Thanks everyone!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|