Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdown into new window

Status
Not open for further replies.

chrisparr21681

Programmer
Nov 18, 2002
17
GB
Hi, i have the dropdown as shown below but need to open it in a new window...i have tried
window.new.location.href = URL; to no avail....please help

function formHandler(form)
{
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option value=" >Getting Started...
<option value=" </select>
</form>
 
in your formHandler function use the window.open javascript function .
 
would the syntax be like this??

function formHandler(form)
{
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.open = URL; (or window.open.href = URL;)
}


if so i cant get either of these to work
 
window.open(url of target, name of new window, attributes of new window)
 
ie:

function formHandler(form)
{
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.open(URL);
}


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top