Launch submit URL in a popup window?

Post any questions you may have here

Launch submit URL in a popup window?

Postby cohncons on Fri May 09, 2008 5:23 pm

I'm trying to use a form to launch a hosted remote control tool.

The url for the remote control host works great in the Submit URL, but it changes the entire page to the remote control host. What I would like to do is have the remote control URL opened in a popup window and have the main form window go to my redirect URL.

Any suggestions?
cohncons
Fresh Boarder
 
Posts: 2
Joined: Fri May 09, 2008 4:46 pm

Re:Launch submit URL in a popup window?

Postby GreyHead on Fri May 09, 2008 7:41 pm

Hi cohncons,

Add the code to open the popup in the 'OnSubmit after' box, this is executed before the main form redirects.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3417
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Launch submit URL in a popup window?

Postby cohncons on Sat May 10, 2008 2:26 pm

Bob,

Thanks for the suggestion. I figured that's where I was going, and had hoped to get the quick three line, "here's how you would do it." But, the exercise in hunting down the answer was rewarding. B)

I now have the popup window working, but I have either uncovered a bug or I'm trying to do more than is possible.

If I put a redirect url in on the Form URLs tab or if I use mosRedirect (doesn't matter if I put it in the on submit before or after code blocks), then the redirects occur, but the popup doesn't launch. If I remove that redirect, then the popup fires properly.

It's not a big issue, because the redirect went to a simple, "Your remote session is launching." page and I just copied that HTML into the on submit -after block.

The first block is the code that launches the popup. I have it in my onsubmit - before block. The second code block in in on submit - after and just serves to keep the main browser window on my site without a blank content area.

I'm sure there's a more optimal way to build the window.open arguments string instead of opening and closing three PHP code blocks, but I needed to keep this simple until I got it working.

Code: Select all
<script type="text/javascript">
{
<?php
require_once("libraries/joomla/utilities/browser_detection.php");

$url = 'https://www.fastsupport.com/';
$name = 'Cohn Consulting Remote Support Tool';
$status = 'status=no,toolbar=no,scrollbars=no,titlebar=no,menubar=no,resizable=no,width=800,height=480,directories=no,location=no';
$user_browser = browser_detection('browser');
if ($user_browser == 'msie7') {
    $name='_blank';
}
$param1 = '?name=' . $_POST['name'];
$param2 = '&supportSessionId=' . $_POST['supportSessionId'];
$url.=$param1 . $param2;
?>
window.open("<?php echo $url ?>","<?php echo $name ?>","<?php echo $status ?>");
window.focus("<?php echo $name ?>");
void(0);
}
</script>



Code: Select all
<h2>Your remote support session has been launched.<br /></h2>
<p>Please answer 'Yes,' 'OK,' or 'Run' when prompted. </p><p> </p>



I guess my bottom line question is should I expect to be able to launch a popup window and redirect the main page at the same time?
cohncons
Fresh Boarder
 
Posts: 2
Joined: Fri May 09, 2008 4:46 pm


Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: Google [Bot], MSN [Bot], MSNbot Media and 4 guests