Forum Moderators: coopster

Message Too Old, No Replies

multi-level drop down menus

how to invoke on php page

         

bomburmusicmallet

7:09 pm on Mar 25, 2007 (gmt 0)

10+ Year Member



Hello,

I am building a search page. There are 5 drop downs from which the user can select search filters. However, some of the drop down list selections will invoke a sub-list.

I was hoping to use javascript only to invoke a refresh when the menu item was selected from the drop down, and then use php to re-build the form plus the sub-list drop down menu.

I can get javascript to refresh the page, but all other form fields are lost. I don't want the user to press "submit" to invoke a sub-list because a "submit" button implies that the search will begin, not that there will be more items to select.

Does anyone know of a way to do this?

Thanks.

dreamcatcher

7:18 pm on Mar 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ajax maybe?

dc

bomburmusicmallet

7:58 pm on Mar 25, 2007 (gmt 0)

10+ Year Member



Maybe? I don't know Ajax.

dreamcatcher

8:28 pm on Mar 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Me neither really. Try a search on Google for changing the select options using Ajax, I`m sure you`ll come across something you can use. Alternatively, check out the JS/Ajax forum here at WW.

[webmasterworld.com...]

dc

coopster

5:20 pm on Mar 26, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You can use JavaScript to invoke the submit and have the PHP processing page take a look at the $_POST variables. If the search submit button is not in the $_POST indexes then you know a search has not yet been requested so you can rebuild the page with the previously selected data as well as the new sub list and continue from there.