Home  |  About  | Last |  Submit  |  Contact
AllQuests.com

Previous Question:  Running program from web page  Just Starting Your DesignNext Question:  Ebay typos are so cool  General Chit Chat
Question Linking Drop Down Menus and dynamically changing page content ( SitePoint Forums Just Starting Your Design )
Updated: 2008-08-12 05:56:26 (4)
Linking Drop Down Menus and dynamically changing page content

Hello everyone,

I was given a project today by my boss and it needs to be complete by 10am tomorrow. The HTML part of it is a cinch, but I am having two problems.

This form needs to have two drop downs that are linked: Category and Sub-Category. Depending on the selection of these drop downs the rest of the page should bring up the corresponding information.

An example: Someone pulls up this form and requests software to be installed. Category will be Software and Sub-Category is Word. Once these are selected the bottom field changes to capture the pertinent information that is needed like software version, licenses needed, etc.

Can anyone direct me to any information that can let me accomplish this?

I hear the linked drop downs will need a database to work and I have no experience in that arena, yet.

Any help appriciated!
JRF2k

Answers: Linking Drop Down Menus and dynamically changing page content ( SitePoint Forums Just Starting Your Design )
Linking Drop Down Menus and dynamically changing page content

Hi. Take a look at this example. See anything you can use. It should be fairly easy to understand the code even if it's poorly commented. Don't ask me exactly how the javascript works. I just copied it off somewhere. It was pretty easy to adjust to my personal needs though.

There are sub-categories for hardware / build. Just click and be amazed.

If you would rather have the menus at the top dropping down I think it's just ordinary positioning. Havent tried it...

About jserr.html: if I understand this correctly, a browser which is not js capable will receive some kind of return value from onClick="return toggle('menu1') and this will force it to follow the link instead. So it's a good idea to have a page for non-js browsers (jserr.html that is).

Otherwise, these are ordinary links. You can use them to load anything you want in the bottom field, or did I get this one wrong?

figbeam

Linking Drop Down Menus and dynamically changing page content

Most browsers now support javascript so you don't have to worry about that problem, unless visitor has js disabled. You can also try http://javascript.internet.com/

webmaster2k5

Linking Drop Down Menus and dynamically changing page content

is the query not regarding drop down lists in forms rather that javascript menus?

By the way I have no idea how this would be done prob need a database and link the lists or maybe it could be done with a server side language with a select case or just a big if statement.

arano

Linking Drop Down Menus and dynamically changing page content

Thanks for the replies.

I got something that will work, but not sure how to get it to work.

Here's what I have.

I frameset divided in the middle - topframe.html and bottomframe.html

Quote:
HTML>
<HEAD>
<TITLE>Frames Example 1</TITLE>
</HEAD>
<FRAMESET cols="20%,80%">
<FRAME SRC="topframe.html" name="topframe">
<FRAME SRC="bottomframe.html" name="bottomframe">
<NOFRAMES>
Sorry, you can't see this page..
</NOFRAMES>
</FRAMESET>
</HTML>
What I want to do is use a drop down box that has items in it. When someone clicks an item then the bottom frame will load up a specific page to collect information.

My form looks like this:

Quote:
<FORM name="Cat_Selection"> <SELECT name="Request_Type" onChange="parent.bottom.location=document.Cat_Selection.Request_Type.options[document.Cat_Selection.Request_Type.selectedIndex].value"> <OPTION SELECTED value="softwareadd.htm">Add Software <OPTION value="hardwareadd.htm">Add Hardware </SELECT> </FORM>
Now, it's the onChange="parent.bottom.location=document.Cat_Selection.Request_Type.options[document.Cat_Selection.Request_Type.selectedIndex].value" I am not sure about. It does appear to work at all. Any ideas what I am doing wrong? JRF2k

JRF2k

Previous Question:  Running program from web page  SitePoint Forums  Just Starting Your DesignNext Question:  Ebay typos are so cool  PS3Forums  General Chit Chat

- Source: Linking Drop Down Menus and dynamically changing page content SitePoint Forums Just Starting Your Design
- Previous Question: Running program from web page SitePoint Forums Just Starting Your Design
- Next Question: Ebay typos are so cool PS3Forums General Chit Chat





AllQuests.com