• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Return URL with parent target

Return URL with parent target 5 years 11 months ago #38225

I have a form inside a popup box and I use the return URL in the end to redirect the user to another page. But, I want that page opening in the parent window. Now, it is opening inside the popup box.

Anyone knows how can I achieve this?

Thanks.
The administrator has disabled public write access.

Return URL with parent target 5 years 11 months ago #38235

I found myself a workaround. i know that this solution is far from the ideal scenario, but it worked very well for me.

First, edit the file: administrator/components/com_rsform/helpers/rsform.php around lines 1950 and 2050 (it may varies depending on your RS Form version), to remove the "document.location" in this piece of code:
// Cache workaround #1
if ($cache_enabled)
	$goto = "document.location='".addslashes($u)."';";
 
if (!empty($form->ReturnUrl))
	$goto = "document.location='".addslashes($form->ReturnUrl)."';";

And in the end it must see like this:
// Cache workaround #1
if ($cache_enabled)
	$goto = addslashes($u);
 
if (!empty($form->ReturnUrl))
	$goto = addslashes($form->ReturnUrl);

Second, go to the file administrator/components/com_rsform/helpers/formlayout/bootstrap3.php (the file will depend on the framework type that you are using. In my case I am using Bootstrap 3, so I will edit the bootstrap3.php file.) In that file you´ll see something like that:
return '<button type="button" class="rsform-submit-button btn btn-primary" name="continue" onclick="'.$goto.'">'.JText::_('RSFP_THANKYOU_BUTTON').'</button>';

In the bootstrap3.php you will find it in the end of the file, line 53. Other files may vary. So change that line to transform the button in a link (tag "a"), so you can use the target property. See:
return '<a type="button" class="rsform-submit-button btn btn-primary" name="continue" href="'.$goto.'" target="_blank">'.JText::_('RSFP_THANKYOU_BUTTON').'</a>';

It´s not possible to make an override for that files, because Joomla only allows overrides for the "views" folder. So remember to make a backup before upgrading RSForm. So you can restore the workaround later.

That´s it!
Last Edit: 5 years 11 months ago by semmerket.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!