PDA

View Full Version : Opening a New Window


him
06-25-2003, 09:49 PM
i have found this code on the internet, it creates a drop down menu for visitors..however, i have one more modification that want to make..i want it to open the links in a new window..how can i do that?


<FORM name="guideform">
<SELECT name="guidelinks">
<OPTION SELECTED value="http://place.com/page1.htm">Page 1
<OPTION value="http://place.com/page2.htm">Page2
</SELECT>

<INPUT type="button" name="go" value="Go!"
onClick="window.location=document.guideform.guidelinks.options
[document.guideform.guidelinks.selectedIndex].value"> </FORM>


thanks,
him

him
06-25-2003, 09:54 PM
also, one quick question on how to edit the border of the drop down box as well as the arrow, i know it is about css..am i right?

him

Jason
06-25-2003, 10:22 PM
within the option tag add a target="_blank" for the new window...


Jason

him
06-25-2003, 10:58 PM
i did try it though..but it doesn't work..! thanks anyway..! just show you quickly show you about my moded code:


<center><FORM name="albumform"><SELECT name="album" class="custom">
<OPTION SELECTED value="#">Please Choose Album :
<OPTION value="01.html" target="_blank">[-Art Exam-]
<OPTION value="02.html" target="_blank">[-Last Offical Day-]
<OPTION value="03.html" target="_blank">[-Last Year Assembly-]
</SELECT>
<INPUT type="button" name="go" value="Start!"
onClick="window.location=document.albumform.album.options
[document.albumform.album.selectedIndex].value"
style="border:1pt #000000
solid;background:#ffffff;color:#000000" style="font-family:Arial"
style="font-size: 7pt;"></FORM>
</center>


him

cheesebagpipe
06-26-2003, 01:39 AM
<FORM name="guideform">
<SELECT name="guidelinks">
<OPTION SELECTED value="http://place.com/page1.htm">Page 1</option>
<OPTION value="http://place.com/page2.htm">Page2</option>
</SELECT>
<INPUT type="button" value="Go!"
onclick="linkwin=window.open(guidelinks.options[guidelinks.selectedIndex].value,'linkwin',features);linkwin.focus()">
</FORM>

features can be configured as described here (http://www.webreference.com/js/tutorial1/features.html).

Forget about that border...

him
06-26-2003, 10:36 AM
i did try the method and the script of you suggested, however it still doesn't work.. :(

him

ellisd5
06-26-2003, 10:47 AM
Try keeping it really simple.
If that doesnt work maybe you have set no pop ups on somewhere.

<INPUT type="button" value="Go!"
onclick="window.open(guidelinks.options[guidelinks.selectedIndex].value, 'myNewWin',features);">

as for changing the colours borders of the dropdown, it is css

Changing the style of the droipdown only works in IE, 4 up I think.

in your select tag add <select style="border: 1px solid #000000">

This would create a 1px think line arounf your drop down, search for css border to look the other border styles you can apply.

Choopernickel
06-26-2003, 02:12 PM
sorry, hharchester. styling select elements works (for me, at least) only in mozilla-based browsers of recent distribution (netscape 7, firebird 0.6, etc)

IE will never support true styling of a select element, though you can change the font and colors of the option elements. This is only possible in IE 5 +.

cheesebagpipe
06-26-2003, 05:14 PM
him -

"it still doesn't work.." doesn't help much. If we could see what 'it' is, the possibility of debugging 'it' arises. :confused:

him
06-26-2003, 05:20 PM
Originally posted by hharchester
Try keeping it really simple.
If that doesnt work maybe you have set no pop ups on somewhere.

<INPUT type="button" value="Go!"
onclick="window.open(guidelinks.options[guidelinks.selectedIndex].value, 'myNewWin',features);">

as for changing the colours borders of the dropdown, it is css

Changing the style of the droipdown only works in IE, 4 up I think.

in your select tag add <select style="border: 1px solid #000000">

This would create a 1px think line arounf your drop down, search for css border to look the other border styles you can apply.

still doesn't work... :( just wanna ask how you guys normally do it with this drop down menu and a button opening in a new window..coz i don't think it would be that complicated if you start from scratch..!

thanks again!!
him

RadarBob
06-26-2003, 05:45 PM
tutorial on how to do CSS dropdown menus, with IE & mozella differences.

http://devedge.netscape.com/viewsource/2003/devedge-redesign-js/

him
06-26-2003, 05:55 PM
not a dhtml drop down menu or whatever it is..it is a form option drop down menu..! thanks for the help anyway!

him

him
06-26-2003, 06:17 PM
forget about it now...coz i have found a new code from dymanic drive and i decide to use that one, thanks for the help buddies! i really appreciate that..! but one more question:

how to disabling scroll bar in .js file?

cheers,
him