Miko Posted December 2, 2009 Share Posted December 2, 2009 Hello, I'm searching the web for about 2hours now for a javascript. The javascript should do the following: I have a combo box with some option values inside, when the visitor selects one of the options it should go to another url. Something like this: http://hostname.com/viewImages.php?val=213&date=20091012 I know that I have to to make my element like this: <select name="name" onChange="javascript()"> But I don't know how to build the javascript that should do what I've mentioned. Somebody knows this? Thanks Link to comment https://forums.phpfreaks.com/topic/183720-need-a-simple-javascript/ Share on other sites More sharing options...
RichardRotterdam Posted December 2, 2009 Share Posted December 2, 2009 <select onchange="gotoUrl(this.value)"> <option value="#">select a location</option> <option value="http://www.chucknorris.com">chuck norris</option> </select> all you basically need is window.location in js Link to comment https://forums.phpfreaks.com/topic/183720-need-a-simple-javascript/#findComment-969683 Share on other sites More sharing options...
Miko Posted December 2, 2009 Author Share Posted December 2, 2009 hi! Ok, it was almost that, but I had to change then onchange="gotoUrl(this.value)" to onchange="document.location(this.value)" Thanks Link to comment https://forums.phpfreaks.com/topic/183720-need-a-simple-javascript/#findComment-969687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.