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

HTML Combo boxes

Reply to Message Icon

Original Message
Name: Rider3
Date: December 15, 2004 at 06:22:54 Pacific
Subject: HTML Combo boxes
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


Report Offensive Message For Removal

Response Number 1
Name: Don Arnett
Date: December 15, 2004 at 09:41:37 Pacific
Subject: HTML Combo boxes
Reply: (edit)

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!


Report Offensive Follow Up For Removal

Response Number 2
Name: RandyH1959
Date: December 15, 2004 at 10:00:36 Pacific
Subject: HTML Combo boxes
Reply: (edit)

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


Report Offensive Follow Up For Removal

Response Number 3
Name: nicolaas
Date: December 16, 2004 at 19:22:32 Pacific
Subject: HTML Combo boxes
Reply: (edit)

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


Report Offensive Follow Up For Removal

Response Number 4
Name: Rider3
Date: December 19, 2004 at 10:03:34 Pacific
Subject: HTML Combo boxes
Reply: (edit)

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!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: HTML Combo boxes

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software