set a $_GET value when option is selected
当选择一个选项时,我如何设置filter_branch=true和filter_branch_val=sony通过$_get?
1 2 3 4 | <select name="filter_brand"> <option>Sony</option> <option>LG</option> </select> |
所以我有类似于
如果Java脚本功能将为您工作。请试试这个代码
HTML
1 2 3 4 5 | <select name="filter_brand" onchange="sendFilter(this.value)"> <option>Sony</option> <option>Lg</option> <option>Samsung</option> </select> |
JavaScript
1 2 3 4 5 6 7 | <script type="text/javascript"> function sendFilter(vaa) { console.log(vaa); window.location.href = 'product.php? filter_branch_val='+vaa+'&filter_branch=true'; } |