Computing.Net > Forums > Web Development > HTML Combo boxes

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

HTML Combo boxes

Reply to Message Icon

Name: Rider3
Date: December 15, 2004 at 06:22:54 Pacific
OS: Win XP Pro
CPU/Ram: 512
Comment:

Help!! I am trying to get two combo boxes to work on my webpage: http://www40.brinkster.com/jrider/pages
then go to car search..
I have car Makes as one combo box and car models. If i select FORD as my cars make from combo box no1. The second combo box model gives options such as cherokee. When there is no such car as a ford cherokee. How do I get only ford models to appear in the second combo box when Ford is selected in the first..... Does that make sense. HELP
Thanks Jason



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: December 15, 2004 at 09:41:37 Pacific
Reply:

The best way to do this is with JavaScript on the client side (in the browser). When someone selects something in then first list box, a javascript function is called which populates the second list box.

I notice now that you are saying combo box. The idea is the same whether list box or combo box. I think a list box would be more appropriate.

I did a google search on "tutorial javascript list box" and found the following page:

http://www.trans4mind.com/personal_development/JavaScript/tripleMenu.js


They have a demo that works but don't give much detail about how to do the code. If you are good with javascript, their example will help, if not, you'll probably want a better tutorial. I viewed the source and the code that you want to see is in a function called "changeSubjects()" and is in a file named "tripleMenu.js". You should be able to download the .js file by putting the filename in the address bar in place of the .html filename.

Or look over the google search for other examples.

Be sure to come back and let us know if our suggestions helped!


0

Response Number 2
Name: RandyH1959
Date: December 15, 2004 at 10:00:36 Pacific
Reply:

I think this site has what you want.
http://javascriptkit.com/script/cut183.shtml


0

Response Number 3
Name: nicolaas
Date: December 16, 2004 at 19:22:32 Pacific
Reply:

I found Javascript to work well in situations like this, but it is (sadly) not processed correctly by most browsers. If you are doing ASP, you are much better off using iframes with asp on the backend. Gives the same smooth operation.

Nico van Niekerk
Calabasas CA USA


0

Response Number 4
Name: Rider3
Date: December 19, 2004 at 10:03:34 Pacific
Reply:

Yep Those suggestions helped alot thanks!
Even though i'd never used Javascript before i found a very simple example to understand at:

http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_15.html

Thanks alot people!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: HTML Combo boxes

Javascript double combo box + array www.computing.net/answers/webdevel/javascript-double-combo-box-array/1219.html

Combo Boxes and ASP www.computing.net/answers/webdevel/combo-boxes-and-asp/1277.html

Stop File Leaching www.computing.net/answers/webdevel/stop-file-leaching/1835.html