abdfahim Posted September 19, 2007 Share Posted September 19, 2007 what ism the problem in the following code? <select name="bsc" onchange="window.location='?category=aaa&bsc='+this.value;"> <option>abcd</option> ........................ ........................ </select> Link to comment https://forums.phpfreaks.com/topic/69843-solved-windowlocation-what-is-the-problem-in-the-code/ Share on other sites More sharing options...
phpwonderkid Posted September 19, 2007 Share Posted September 19, 2007 try this <select name="bsc" onchange="window.location=somepage.php?category=aaa&bsc="+this.value;> <option>abcd</option> ........................ ........................ </select> Link to comment https://forums.phpfreaks.com/topic/69843-solved-windowlocation-what-is-the-problem-in-the-code/#findComment-350873 Share on other sites More sharing options...
nogray Posted September 19, 2007 Share Posted September 19, 2007 It should be location.href (or window.location.href) Link to comment https://forums.phpfreaks.com/topic/69843-solved-windowlocation-what-is-the-problem-in-the-code/#findComment-351422 Share on other sites More sharing options...
abdfahim Posted September 21, 2007 Author Share Posted September 21, 2007 I tried both, but Not working.. I forgot to tell you, this code works fine in Mozilla Firefox and Opera, but don't work in IE. In internet explorer, the address of the page loaded OnChange is "http://localhost/somepage.php?category=aaa&bsc=" that is IE cant read this.value of the script. Link to comment https://forums.phpfreaks.com/topic/69843-solved-windowlocation-what-is-the-problem-in-the-code/#findComment-352036 Share on other sites More sharing options...
abdfahim Posted September 21, 2007 Author Share Posted September 21, 2007 I have another observation. If i write <input type="text" name="bsc" onchange="window.location.href='?category=aaa&bsc='+this.value;"> then IE can run the correct script (can read this.value). Is that mean that IE can't get element of a SELECT type using this.value? Link to comment https://forums.phpfreaks.com/topic/69843-solved-windowlocation-what-is-the-problem-in-the-code/#findComment-352053 Share on other sites More sharing options...
abdfahim Posted September 21, 2007 Author Share Posted September 21, 2007 ok, I have get the solution ... I should put the value in the option, like <option value="abcd">abcd</option> Link to comment https://forums.phpfreaks.com/topic/69843-solved-windowlocation-what-is-the-problem-in-the-code/#findComment-352197 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.