w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
I'm not able to change the page contents when i select combo-box options in php

Your code is lacking Javascript, which would be required for the outcome you are expecting. Seeing as you haven't really defined the complete outcome you expect, I will just show you what you need to update the url with the currently selected store:

$selectBoxOpen = "<select name='store_name' onchange="location.href=location.href+'?store='+this.value" >";

I've added an onchange event (read more about DOM events here) so that when you select a different value you are changing the location.

Now when you change the value of the select, your url should change to scriptname.php?store=SomeStoreName





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.