Products Selects with Ajax

Associate
Joined
16 May 2005
Posts
680
Hi

I want to put some selects on my page to allow people to navigate through 3 levels of navigation i.e.

Department > Manufacturer > Product

but I only want to show one select at a time, so if someone selects from the departments it will reload page.php?department_id=1 with the manufacturers in that department and then they can select a manufacturer from the newly appeared select so it reloads again with page.php?manufacturer_id=8&department_id=1 and so on and so forth.

This I think will be fine, but I was wondering if I can get Ajax to do it without the page reload? I've got a couple of Ajax books which I had a flick through and couldn’t find anything matching it.

I’ve got some Javascript that will allow people to select the department, which then creates a new list in the select below it, but that means showing the select there with a "Please select from above" message which I would like to get around.

Any input appreciated

Cheers
 
Last edited:
You could get javascript to create the selects from scratch, as opposed to changing the values. Or you could put the selects in divs at 0 height, and show them (by enlarging height) when the correct option is selected.

I know what your asking is possible in AJAX, but personally i don't have enough experience in the field to give you an answer.
 
Hi

Thanks for the input, I managed to find a script that generated select options for additional selects based on a previous selections, and combine it with a script that hid and showed the selects.

Damn complicated, lines and lines of script but works like a charm! AJAX might be neater but time contraints means it'll have to do for now.
 
Back
Top Bottom