Go to Pop Up Menu From Drop Down List

They have: 42 posts

Joined: Dec 2002

Hi All

I need to launch a Pop Up Menu from a drop down List:

-------Select a Region--------
home

The drop down list does not need to be the one above but I need code that when I select option value it launches a pop up for the destination page.

Thanks for any help!
NYColt

xxgeek's picture

He has: 17 posts

Joined: Jan 2004

Try this:
Put this between your ... tags

<script type="text/javascript">
function popupwindow() {
empty=document.goto.menu.options[document.goto.menu.selectedIndex].value
if (empty.indexOf("none")==0) {
alert('Please choose from menu.')
}
else
{
SomeName=window.open  ('','SomeName',config='height=400,width=400,resizable=yes,toolbar=0,scrollbars=0,status=1');SomeName.location=empty;
}
}
</script>
'
this is your function to open a new window or alert is there is no selection..
the config is straight forward so u should be able to figure that out..
than just call your function within the site like so:
<form name="goto">
<select name="menu">
<option selected value="none">-------Select a Region--------
<option value="http://mysite.com/test">home
</select>
<input type="button" value="OK" onClick="popupwindow()">
</form>
'
That should do the trick, let me know if it worked for you,,
THX

VENI VIDI VICI

They have: 42 posts

Joined: Dec 2002

Thank you VERY Much, that is exactly what I needed!

NYColt

xxgeek's picture

He has: 17 posts

Joined: Jan 2004

No Prob... glad to help Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.