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> Quote Link to comment 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> Quote Link to comment 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) Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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> Quote Link to comment 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.