• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Drop-Down box query

onimkron

OSNN Senior Addict
#1
Just wondering if anyone can help me out on this...

Code:
<form action="areas" method="post">
<select name="opsmenu1" size="5">
<option value="ih01/demil/fm16/index.htm*_blank">FM16 Area</option>
<option value="ih01/demil/fm21/index.htm*_blank">FM21 Area</option>
</select>
<input TYPE="button" VALUE="GO!" onClick="jump(this.form)">
</form>
At the moment, it's fine; clicking on a link and selecting 'go' makes it load the selected html page on a different window. What I want to do is make it so that the new window is of a predefined size, possibly with "width" and "height" tags, but I've got no idea on how to do so :confused:

Any help will be appreciated

Edit: Ah wait, nevermind, I solved it through the java script code near the <head>. Please disregard this post :eek:
 

j79zlr

Glaanies script monkey
Political User
#2
I would change a bit:

Code:
<form name="menu1" method="post" action="">
<select name="links">
<option value="ih01/demil/fm16/index.htm*_blank">FM16 Area</option>
<option value="ih01/demil/fm21/index.htm*_blank">FM21 Area</option>
</select>
<input type="button" name="go" value="Go!" onclick="window.open(url, '', 'width=350,height=400,toolbars=no,status=no,scrollbars=yes,resizable=yes')"> 
<script>
var url = document.menu1.links.options[document.menu1.links.selectedIndex].value;
</script>
</form>
Obviously you can change the window attributes to your liking, width=350,height=400,toolbars=no,status=no,scrollbars=yes,resizable=yes
 

onimkron

OSNN Senior Addict
#3
Very nice, thanks for that. I opted to change the java script code instead, since that would allow me to use other window sizes for different links, rather than restrict it to those in the drop-down box. For example, _blank for video files, _blankpic for galleries etc, with varying window sizes on pop up.

Thanks for the code though, would've saved me a lot of time :)
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,016
Latest member
ernestrojasn