Jump to content

chained dropdowns


Karyna

Recommended Posts

hi everyone

i have a question i tought was easy but im having some problems i have 3 dropdowns menus the customer select one category from one of them.. let say "pets" the the other dropdown must be filled with pets (dogs, cats, parrots...) if the customer select dogs the 3rd dropdown must filled with (doberman, bulldog,chihuhaua, etc) i think u got the idea.. but im having trouble with the 2nd and 3rd dropdown... any ideas:::

 

tnx in advncd

Link to comment
https://forums.phpfreaks.com/topic/262088-chained-dropdowns/
Share on other sites

It can be done with submission using 

<select name="pets" onchange="this.form.submit()">

if all processing is done on the same page.  All posed values are echoed back to the form.  You then add

if (isset($_POST['pets'])){
//Show subcat selection
}

Then Again for the subcat post.

You'll need to name you "submit" button so full processing is only done when the button is clicked.  I've done this type of multi selections on a number of sites and it's worked well.

Link to comment
https://forums.phpfreaks.com/topic/262088-chained-dropdowns/#findComment-1343155
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.