Contain subsequent page loading
Moderator: General Moderators
Contain subsequent page loading
Hi,
I'm putting together a little DHTML popup which contains a form passing contact details to a SwiftMailer script - note that the popup is created using a phpAdsNew banner popup.
I've managed to get the things working in a rudementary fashion however the HTTP Post to the Swift script always opens a full browser window (which is blank as the operation was successful). I'm looking for a way for this not to happen at all or to have the page at least load within the pop-up window.
Any help would be fantastic
Martin
I'm putting together a little DHTML popup which contains a form passing contact details to a SwiftMailer script - note that the popup is created using a phpAdsNew banner popup.
I've managed to get the things working in a rudementary fashion however the HTTP Post to the Swift script always opens a full browser window (which is blank as the operation was successful). I'm looking for a way for this not to happen at all or to have the page at least load within the pop-up window.
Any help would be fantastic
Martin
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
feyd | Please use
Cheers and thanks for the help - the new window (or any window) popping up after the submit button is really bugging me.
Martin
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi Everah,
Thanks for replying - would certainly appreciate you checking it out - fairly basic Dreamweaver form below:
[syntax="html"]
<script type="text/javascript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</script>
<body bgcolor="#FFFFFF">
<h1 align="center"><font color="#840283" size="4" face="Verdana, Arial, Helvetica, sans-serif">Zeolites Health Special Report</font> </h1>
<h5 align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Want a sharp concise report of Natural Cellular Defense?<br />
Please complete the autoresponder form below and this report will be immediately emailed to you </font></h5>
<form action="http://www.zeoliteshealth.com/Swift/send_attachment.php" method="post" name="contact_us_form" target="_parent" id="contact_us_form">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">name: </font></div></td>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<label for="textfield"></label>
<input name="name" type="text" id="name" value="Please Enter Name here" size="40" maxlength="50" />
</font></td>
</tr>
<tr>
<td><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">email address: </font></div></td>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<input name="email_address" type="text" id="email_address" size="40" maxlength="50" />
</font></td>
</tr>
<tr>
<td><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">phone number: </font></div></td>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<input name="phone_number" type="text" id="phone_number" size="40" maxlength="40" />
</font></td>
</tr>
<tr>
<td><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">comment: </font></div></td>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<textarea name="comment_field" cols="37" rows="5" wrap="virtual" id="comment_field">Please send me the special report on Natural Cellular Defense.
</textarea>
</font></td>
</tr>
<tr>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<input name="recipient" type="hidden" id="recipient" value="martin@zeoliteshealth.com" />
<input name="subject" type="hidden" id="subject" value="Special Report" />
</font></td>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<input name="Click to Send" type="submit" id="Click to Send" onclick="MM_popupMsg('Thank-you.\rThe Report will be in your email shortly.')" value="Click to Send" />
<input name="Reset Form" type="reset" id="Reset Form" value="Reset Form" />
</font></td>
</tr>
</table>
</form>
<div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">All information submitted is kept strictly confidential.</font></div>
Martin
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Lets see if I have this problem understood. You are popping open a window that contains a form. When the form submits, it opens another (third) window that is blank because the page that is receiving the form post is a mailer script that sends a mail and does nothing else. Am I correct?
If I understand this correctly, what you want to do is, in the first opened window (the one with the form - window 2) is not specify a target attribute in the form. So this:
Would become this
Then, on the http://www.zeoliteshealth.com/Swift/send_attachment.php page, after the mailing has been done, I would use some javascript to close window 2 and second focus back to the parent window. Maybe something along the lines of...
which I would call with the onLoad event of the body tag
I am certainly no pro at Javascripting, but this is the logic I would use anyway. Window 1 opens window 2. Window 2 handles an input, processes the input, closes itself and returns focus to window 1.
If I understand this correctly, what you want to do is, in the first opened window (the one with the form - window 2) is not specify a target attribute in the form. So this:
Code: Select all
<form action="http://www.zeoliteshealth.com/Swift/send_attachment.php" method="post" name="contact_us_form" target="_parent" id="contact_us_form">Code: Select all
<form action="http://www.zeoliteshealth.com/Swift/send_attachment.php" method="post" name="contact_us_form" id="contact_us_form">Code: Select all
function send_back_to_caller()
{
opener.document.location.href = "some_page_to_go_to.php";
window.close();
}Code: Select all
<body onLoad="send_back_to_caller();">I must be doing something wrong here or simply not understanding your solution.
I think you have my requirements understood. I have a site running phpAdsNew - phpAdsNew is creating a popup that contains a form. This form POSTS to a php mailer script that sends a PDF. I'm wanting to use phpAdsNew as it has Geographic facilities to allow me to tailor the documentation sent.
I've removed the target="_parent" tag and the popup still allows this php mailer window to be created - is there no way that using a DHTML popup that the mailer window can remain in the pop-up, at the very least?
I'm a little confused with the JS code. Is this to close the mailer window or the form window? Is there any way to prevent the mailer window from opening in the first place?
Window 1 - main site
window 2 - form page that posts to mailer script (nice if this could close after submitting)
window 3 - mailer script that opens a full browser window. (prefer this not to open in the first place)
I'm beginning to think this is a bug / inablility with phpAdsNew to carry out basic execution.
I think you have my requirements understood. I have a site running phpAdsNew - phpAdsNew is creating a popup that contains a form. This form POSTS to a php mailer script that sends a PDF. I'm wanting to use phpAdsNew as it has Geographic facilities to allow me to tailor the documentation sent.
I've removed the target="_parent" tag and the popup still allows this php mailer window to be created - is there no way that using a DHTML popup that the mailer window can remain in the pop-up, at the very least?
I'm a little confused with the JS code. Is this to close the mailer window or the form window? Is there any way to prevent the mailer window from opening in the first place?
Window 1 - main site
window 2 - form page that posts to mailer script (nice if this could close after submitting)
window 3 - mailer script that opens a full browser window. (prefer this not to open in the first place)
I'm beginning to think this is a bug / inablility with phpAdsNew to carry out basic execution.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
I would suggest, first, that you clear your browser cache. Then load the pages again. The only reason your form would be opening a new window is if it is told to do so in the target attribute of the <form> tag. The only other attribute value I can think of for target (to force it to load in the current page) is "_top".
What I had suggested in my last post is that you post back the form so that it sends the form data to itself, processes the data sending (mailing) then closes itself.
What I had suggested in my last post is that you post back the form so that it sends the form data to itself, processes the data sending (mailing) then closes itself.