mercredi 26 avril 2017

How to link to form select option dropdowns

I have a webpage using a search box in header & in body of homepage. Both Header form & form in body of homepage are the same and query the same search page.

My Question is how could I link dropdowns so that when one changes the other follows.

At the moment I am using php to switch to appropriate categories on arrival to page(s).
eg: <option value='-1' <?php if ($cat == "-1") {print("selected");}?>>All Categories</option> <option value='0'<?php if ($cat == "0") {print("selected");}?>>Category One</option> <option value='1' <?php if ($cat == "1") {print("selected");}?>>Category Two</option>

Which works great when arriving on page(s) after query.

However Because there are duplicate forms on my home page I was hoping to somehow dynamically change the < select >< options > on homepage body when < select >< options > in header is changed & visa-versa?

Any ideas?




Aucun commentaire:

Enregistrer un commentaire