Forum Moderators: open
Here`s my code:
<select name="cat" onChange="MyWindow=window.open('this.options[this.selectedIndex].value', 'MyWindow','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes, left=200,top=0,screenX=100,screenY=60,resizable=yes, width=600,height=400');">
<option selected value="0"> </option>
<option value="view_stats.php?action=show&display=all">All</option>
<option value="view_stats.php?action=show&display=4">Movies</option>
<option value="view_stats.php?action=show&display=2">Music</option>
<option value="view_stats.php?action=show&display=5">People</option>
</select>
Now its working in the sense that a new window is opening, but the URL has this.options[this.selectedIndex].value in it, which is obviously no good. I want the values of the options to be the URL.
This is probably something simple, but I really don`t know javascript.
My SECOND question is, how do I have it so that if someone selects the option with a value of 0, nothing happens?
Many thanks.
:)