If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

You can use Ajax to onChange(this.value) of the manufacturer select, query your database with "WHERE `manufacturer`= 'value.passed.to.js.function'". Then populating your second dropdown with the return results.

2) Preload every list.

This is the option I would use. If I'm a user on your site and I have to wait X seconds every time I want to see a new list of models, I'm not happy.

I would use PHP to query your database for (unfortunately) your entire table (unless you know you don't need a few rows) for the `id`, `manufacturer`, and `model` columns (unless you need more).

Using those results, I would print them out into a javascript array and use the onChange() function of the manufacturer select to call for the respective array, which would populate the model select.

Originally Posted by 367

when submit button is clicked it should lead to page of model, like this: index.php?p=view&m=shop&id=<certain_id>

That can be easily done with Javascript. You need to use Client-Side Coding for that then use event triggers where selecting one option will trigger different values to be loaded on the other Drop-Down list.