Click to See Complete Forum and Search --> : pop-up window coding help please
newbie_web
08-15-2003, 03:11 PM
Hello,
I am trying to make a pop-up window after a person clicks on the "submit" button on a form I created. I want to make my pop-up have 2 options, with one button taking them back to a new form to enter another request and the other button to return them to the homepage. I figured out how to create these buttons, but it opens up a new window. I am trying to use the pop-up window as an option window and once they choose the button. I want the page to be displayed on the original window and have the pop-up window disappear. I keep having a new window opening. Any help would be greatly appreciated!
-Newbie
Post the code you are using for the buttons
newbie_web
08-18-2003, 06:47 AM
My codes are:
<SCRIPT LANGUAGE= "JavaScript">
<!--
aWindow=window.open("success.asp","thewindow","toolbar=no,width=250,height=150,status=no,scrollbars=no,resize=no,menubar=no");
//-->
</SCRIPT>
success.asp:
<!-- START OF SCRIPT -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function PopIt(label, msg, URLE){
// Set up Page Colors & Table
var DQUOTE = '\"'
var s1 = "<TITLE>" + label + "</TITLE>" +
"<BODY BGCOLOR='ffffff'><TABLE BORDER=0><TR>" +
"<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
"<FONT SIZE=4>"
var s2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><P>"
var s3 = "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
"<TD VALIGN=TOP ALIGN=RIGHT>"+
"<FORM><INPUT TYPE='BUTTON' VALUE='Close'" +
"onClick='self.close()'>" +
"<INPUT TYPE='BUTTON' VALUE='Jump to!'" +
"onClick='window.open("+DQUOTE+URLE+DQUOTE+")'" +
"</FORM></TD></TR></TABLE></BODY>"
popup = window.open("","popDialog","height=200,width=300,scrollbars=no")
popup.document.write(s1+s2+msg+s3)
popup.document.close()
}
// -->
</SCRIPT>
</HEAD>
<A HREF="JavaScript:PopIt('Link1','A resource with 1 million ways to improve your site!','../forms/fin18.asp')">Link1</A>
<BR>
<A HREF="JavaScript:PopIt('Link2','A resource with 2 million mistakes you shouldn´t make!','http://www.fins.com')">Link2</A>
<!-- END OF SCRIPT -->
Thanks for your help
newbie_web
08-18-2003, 06:51 AM
My codes are:
<SCRIPT LANGUAGE= "JavaScript">
<!--
aWindow=window.open("success.asp","thewindow"," toolbar=no,width=250,height=150,status=no,scrollba
rs=no,resize=no,menubar=no");
//-->
</SCRIPT>
success.asp:
<!-- START OF SCRIPT -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function PopIt(label, msg, URLE){
// Set up Page Colors & Table
var DQUOTE = '\"'
var s1 = "<TITLE>" + label + "</TITLE>" +
"<BODY BGCOLOR='ffffff'><TABLE BORDER=0><TR>" +
"<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
"<FONT SIZE=4>"
var s2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><P>"
var s3 = "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
"<TD VALIGN=TOP ALIGN=RIGHT>"+
"<FORM><INPUT TYPE='BUTTON' VALUE='Close'" +
"onClick='self.close()'>" +
"<INPUT TYPE='BUTTON' VALUE='Jump to!'" +
"onClick='window.open("+DQUOTE+URLE+DQUOTE+")'" +
"</FORM></TD></TR></TABLE></BODY>"
popup = window.open("","popDialog","height=200,width=300,scrollbars=no")
popup.document.write(s1+s2+msg+s3)
popup.document.close()
}
// -->
</SCRIPT>
</HEAD>
<A HREF="JavaScript:PopIt('Link1','../forms/fin18.asp')">Link1</A>
<BR>
<A HREF="JavaScript:PopIt('Link2','http://www.fins.com')">Link2</A>
<!-- END OF SCRIPT -->
Thanks for your help
neil9999
08-18-2003, 06:53 AM
window.open opens a new window, window.location opens in the same window.
neil
Take a look at the attached file to see if we are on the right track.
When you download the file save it as a .htm file