Launching Pop Up Windows

windows

Guest
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. <br />
<br />
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. <br />
<br />
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 <br />
<br />
<FORM> <br />
<OPTION VALUE="#">the pop up window javascript with links</OPTION <br />
<FORM> <br />
<br />
eg. the option tags are part of a jump menu. <br />
<br />
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. <br />
<br />
Does anyone know if this is possible? <br />
<br />
What code I need to use? <br />
<br />
Where the code should sit on the page? <br />
ie <HEAD> or <BODY> or before </OPTION> <br />
<br />
If this isn't possible an alternative approach <br />
<br />
Thankyou for your help in anticipation. <br />
<br />
ANSWERS:<br />
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<br />
Your codes should be as follows:<br />
// a pop-up menu with links<br />
<STYLE><br />
.menu {position: absolute; top: -1000; left: -1000}<br />
</STYLE><br />
<script><br />
function showpopup(){<br />
var win = window.createpopup();<br />
<br />
win.show(10,10,340,200);<br />
}<br />
</script><br />
<body><br />
<FORM> <br />
<OPTION VALUE="#"><A HREF=http://www.webdeveloper.com/forum/archive/index.php/鏀媋vasript:showpopup();?gt;<br />
the pop up window javascript with links </A><br />
</OPTION><br />
</FORM><br />
</body><br />
<br />
all the best frm:<br />
Bahj<!--content-->i was answering a question a while back that was similar to this one and created this script.<br />
this will do the trick<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<html><br />
<head><br />
<title></title><br />
<script language="JavaScript" type="text/JavaScript"><br />
<!--<br />
<br />
function goto(obj) {<br />
var list = obj.options[obj.selectedIndex].value;<br />
if (myForm.newWin.checked == true && list.length > 0){<br />
window.open(list,'newWin');<br />
}<br />
if (myForm.newWin.checked == false && list.length > 0){<br />
window.location.href = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/list;">http://www.webdeveloper.com/forum/archi ... .php/list;</a><!-- m --><br />
}<br />
}<br />
/* remove below here if you don't want the page to be opened in the same window and remove checkbox */<br />
function checkbox(obj){<br />
if (obj.checked == false){<br />
obj.checked = true;<br />
}else{<br />
obj.checked = false;<br />
}<br />
}<br />
// end remove<br />
//--><br />
</script><br />
</head><br />
<body><br />
<form name="myForm"><br />
<label><a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript:checkbox(myForm.newWin);">Open In New <br />
Window:</a> <br />
<input name="newWin" type="checkbox"><br />
</label><br />
<select name="myList" onChange="goto(myForm.myList)"><br />
<option selected value="">Goto Page</option><br />
<option value="apage.htm">Page A</option><br />
<option value="bpage.htm">Page B</option><br />
<option value="cpage.htm">Page C</option><br />
</select><br />
</form><br />
</body><br />
</html><!--content-->
 
Back
Top