...

View Full Version : Dropdown menu



Wobbler
08-04-2002, 06:34 PM
Can somebody tell me how to do a Dropdown menu with button to click efter your chooise, but when you click the button a new window popup, WITHOUT scroller,menu e.tc!!

Please help, thanks

ACJavascript
08-04-2002, 07:50 PM
Try this :D

------------

<script language="javascript">

function go(){

var url=document.forms[0].urlSelect.options[document.forms[0].urlSelect.selectedIndex].value

window.open(url,"newWindow","scroll=no,menuba=no,status=no")

}

</script>

<form>
<select name="urlSelect">
<option value="">Choose A Page
<option value="http://www.acjavascripts.com">ACJavascripts
<option value="http://www.wsabastract.com">Javascript Kit
<option value="http://www.java-scripts.net">Java-scripts.net
</select>
<input type="button" value=" - GO - " onclick="go()">
</form>

---------

Hope this helps :D:D

vera
08-04-2002, 07:51 PM
Well, the button doesn't necessarily have anything to do with a dropdown. To just go somewhere in a new (plain) window with a button you can do this:

<input type="button" value=" Go "
onclick="open('page.html',
'','width=300,height=200,scrollbars,resizable')">

Set the width and height as needed, remove scrollbars and resizable options as needed.

If you want the selection from the dropdown to pick the page to load into the new window you can do this:

<select name="s1">
<option value="/index.html">Home</option>
<option value="http://somewhere.com">Somewhere</option>
<option value="/deals/good.html">Good Deals</option>
</select>
<input type="button" value=" Go "
onclick="w1=open(s1.options[s1.selectedIndex].value,
'','width=300,height=200,scrollbars,resizable');
w1.focus()">

Note that the dropdown is named "s1" and that this same name occurs in 2 places in the button 'onclick', so the name must agree in those 3 places if you change it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum