Click to See Complete Forum and Search --> : Launching Pop Up Windows


kamio
12-18-2002, 09:49 AM
I am currently creating a site that acts as a database. Essentially a few data pages with an awful lot of navigation pages. The problem i am having is that some of the data overlaps. So the navigation essentially needs to point to two different places.

The person I am building this for would like to see a pop up window in this situation advising of the overlap and giving links to the different data sources.

What I want to achieve is launching the POP up window with generic text and specified links with Javascript/DHTML from within an HTML structure like this

<FORM>
<OPTION VALUE="#">the pop up window javascript with links</OPTION
<FORM>

eg. the option tags are part of a jump menu.

I am confident with HTML but Javascript is reasonably new to me. I have used free code from the internet before in my sites but never had to code any by hand.

Does anyone know if this is possible?

What code I need to use?

Where the code should sit on the page?
ie <HEAD> or <BODY> or before </OPTION>

If this isn't possible an alternative approach

Thankyou for your help in anticipation.

ANSWERS:
HI . The answer is quite straightforward. You create a pop-up window before the BODY tag and call the function where you define the pop-up attributes inside anywhere within the body part of the document. I hope this helps
Your codes should be as follows:
// a pop-up menu with links
<STYLE>
.menu {position: absolute; top: -1000; left: -1000}
</STYLE>
<script>
function showpopup(){
var win = window.createpopup();

win.show(10,10,340,200);
}
</script>
<body>
<FORM>
<OPTION VALUE="#"><A HREF=”javasript:showpopup();”>
the pop up window javascript with links </A>
</OPTION>
</FORM>
</body>

all the best frm:
Bahj

ShrineDesigns
12-19-2002, 02:46 AM
i was answering a question a while back that was similar to this one and created this script.
this will do the trick

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--

function goto(obj) {
var list = obj.options[obj.selectedIndex].value;
if (myForm.newWin.checked == true && list.length > 0){
window.open(list,'newWin');
}
if (myForm.newWin.checked == false && list.length > 0){
window.location.href = list;
}
}
/* remove below here if you don't want the page to be opened in the same window and remove checkbox */
function checkbox(obj){
if (obj.checked == false){
obj.checked = true;
}else{
obj.checked = false;
}
}
// end remove
//-->
</script>
</head>
<body>
<form name="myForm">
<label><a href="javascript:checkbox(myForm.newWin);">Open In New
Window:</a>
<input name="newWin" type="checkbox">
</label>
<select name="myList" onChange="goto(myForm.myList)">
<option selected value="">Goto Page</option>
<option value="apage.htm">Page A</option>
<option value="bpage.htm">Page B</option>
<option value="cpage.htm">Page C</option>
</select>
</form>
</body>
</html>