Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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!

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

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!

![]() |
![]() |
![]() |

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