Popup windows from Dropdown box

I

Ian Hubling

I've spent hours adapting various scripts from this forum, but haven't
been able to make anything work yet. Any help would be appreciated.

What I want seems simple - which is why I can't believe I can't find
it in the archives.

I want to create a simple dropdown - so that selecting any item will
force a popup window to appear. I need to control the size and
atributes of the popup window (ie the popup window will show sample
colors / patterns of a product).

Thanks.
 
K

kaeli

I want to create a simple dropdown - so that selecting any item will
force a popup window to appear. I need to control the size and
atributes of the popup window (ie the popup window will show sample
colors / patterns of a product).

Do you want the popup to open a pre-existing page or do you want to
write to a new document?
The script will differ greatly depending.

I'll assume you're opening an already existing document, as that's much
easier. ;)
Watch for word-wrapping.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> New Document </title>

<script language="javascript" type="text/javascript">
var p_window=null;
function popWindow(action)
{
if (action == "0") return;
p_window = window.open(action,"Sample","height=300,width=
300,scrollbars=yes,resizable=yes");
p_window.focus();
}
</script>
</head>
<body>
<form name="f1">
<select name="s1" onChange="popWindow(this.options
[this.selectedIndex].value)">
<option value="0">-- Choose One --</option>
<option value="page1.html">Sample 1</option>
<option value="page2.html">Sample 2</option>
<option value="page3.html">Sample 3</option>
<option value="page4.html">Sample 4</option>
</select>
</form>
</body>
</html>

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top