j5646w Posted May 22, 2011 Share Posted May 22, 2011 Hi there I have a problem with the following code If I select the dropdown option it shows - ad.php?id=animal& region= The Value is not been retrieved - what am I doing wrong? <select onChange="window.location='ad.php?id=<? print ($type); ?>& region=' + this.value" id="reg" name="reg" title="Select Region"> <option value"">All Region</option> <option value"eastern cape">Eastern Cape</option> <option value"free state">Free State</option> <option value"gauteng">Gauteng</option> <option value"kwazulu natal">KwaZulu Natal</option> <option value"limpopo">Limpopo</option> <option value"mpumalanga">Mpumalanga</option> <option value"northern province">Northern Province</option> <option value"western cape">Western Cape</option> </select> </form> Quote Link to comment https://forums.phpfreaks.com/topic/237094-dropdown-menu-onchange-help/ Share on other sites More sharing options...
sunfighter Posted May 23, 2011 Share Posted May 23, 2011 Bet your using IE. IE has problems with how they use 'this'. BTW your code is good in FF. Change this.value to this.options[this.selectedIndex].value. But I don't know what this does in IE8. Quote Link to comment https://forums.phpfreaks.com/topic/237094-dropdown-menu-onchange-help/#findComment-1218914 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.