Welcome to WebmasterWorld Guest from 54.90.204.233

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

multi-level drop down menus

how to invoke on php page

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

Junior Member

10+ Year Member

joined:Apr 13, 2005
posts:68
votes: 0


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.

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

Senior Member

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 30, 2003
posts:3719
votes: 0


Ajax maybe?

dc

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

Junior Member

10+ Year Member

joined:Apr 13, 2005
posts:68
votes: 0


Maybe? I don't know Ajax.
8:28 pm on Mar 25, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 30, 2003
posts:3719
votes: 0


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

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

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12548
votes: 2


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.