Redirect on modal form back to current page

This area is devoted to Magento Form Builder SmartFormer Gold. Please ask questions, report bugs and share ideas here.

Redirect on modal form back to current page

Postby austin.colby » Wed Oct 05, 2011 8:54 pm

Hello -

I am using your lightbox capabilities from a previous post and am having issues with the submit action. What I would like to do is after the submission of the form from the lightbox, I would like it to redirect back to the current page so that it refreshes everything. For some reason the page does not display properly after the submit currently and if I reload the page after that, everything is fine. It appears though once you click submit, it closes the window and does not execute my script to redirect. Below is the code that I have so far and would appreciate any help.

Code: Select all
/*******************************************************************/
/* SmartFormer Gold © Form PHP controller                                                     */
/*                                                                                                                  */
/* Product of IToris © 2009 http://www.itoris.com                                       */
/*                                                                                                                  */
/*******************************************************************/

$currentUrl = $this->helper('core/url')->getCurrentUrl();

$form->getPostedValues();

$form->doAfterSubmitAction();

if ($form->page == 0) { // ensure the script runs only once
   if (isset($form->data['BBT_recommend'])){
      $mainframe->redirect($currentUrl);
   }
}

$form->renderForm();

echo $form->page_html;
austin.colby
 
Posts: 5
Joined: Mon Jan 17, 2011 7:35 pm

Re: Redirect on modal form back to current page

Postby austin.colby » Wed Oct 05, 2011 10:20 pm

Even better yet, is there a way to dynamically override the redirect URL specified for the submit button or change the event trigger using PHP?
austin.colby
 
Posts: 5
Joined: Mon Jan 17, 2011 7:35 pm


Return to SmartFormer Gold for Magento

Who is online

Users browsing this forum: No registered users and 1 guest