prakash Posted December 27, 2007 Share Posted December 27, 2007 how can I set the location to url like ?action=manage&zone=2 following code is not working and seems it has some mistakes onchange="if(options[selectedIndex].value) window.location.href='?action=manage&zone='.(options[selectedIndex].value)" everything is working except the part '?action=manage&zone='. so how to join the part there Quote Link to comment Share on other sites More sharing options...
mainewoods Posted December 28, 2007 Share Posted December 28, 2007 use the '+=' concatenation operator. window.location.href+='?action=manage&zone='.(options[selectedIndex].value)" --the above will only work if the filename does not already have url passed parameters. if that is the case you must do some extra things Quote Link to comment Share on other sites More sharing options...
prakash Posted December 28, 2007 Author Share Posted December 28, 2007 use the '+=' concatenation operator. window.location.href+='?action=manage&zone='.(options[selectedIndex].value)" --the above will only work if the filename does not already have url passed parameters. if that is the case you must do some extra things I tried with following code as per your instructions onchange="if(options[selectedIndex].value) window.location.href+='?action=manage&zone='.(options[selectedIndex].value)" but it not working at all. any idea?? Quote Link to comment Share on other sites More sharing options...
prakash Posted December 28, 2007 Author Share Posted December 28, 2007 topic solved using onchange="if(options[selectedIndex].value) window.location.href='?action=manage&urlZone='+(options[selectedIndex].value)" 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.