Submit to URL and Redirect Page

  • newhallklein
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

newhallklein created the topic: Submit to URL and Redirect Page

I'm attempting two actions after Submit. I need to send the form output to a remote URL (CRM) and also redirect the user to a thank you page on the site. Both scripts work independently, but I can't figure out how to make them work together.

I'm putting them in Submit Pieces > End Submit

REMOTE URL SCRIPT:

$this->execPieceByName('ff_InitLib');
echo '
<form name="signupresubmit" method="post" action=" www.pages03.net/reinhartfoodservice/cont...aurantInc_SignUpPage " pageId="10912359" siteId="429019" parentPageId="10912357">
<input type="hidden" name="Customer_FirstName" value="'.htmlentities( ff_getSubmit('firstname') ).'"/>
<input type="hidden" name="Customer_LastName" value="'.htmlentities( ff_getSubmit ('lastname') ).'"/>
<input type="hidden" name="Email" value="'.htmlentities( ff_getSubmit ('email') ).'"/>
<input type="hidden" name="RestaurantOperator_Indicated_YN" value="'.htmlentities( ff_getSubmit ('restaurantoperator') ).'"/>
<input type="hidden" name="Account_Name" value="'.htmlentities( ff_getSubmit ('establishment') ).'"/>
<input type="hidden" name="Customer_Indicated_YN" value="'.htmlentities( ff_getSubmit ('reinhartcustomer') ).'"/>
<input type="hidden" name="Customer_Number_OLD" value="'.htmlentities( ff_getSubmit ('customernumber') ).'"/>
<input type="hidden" name="Pref_News_Updates_YN" value="'.htmlentities( ff_getSubmit ('moreinfo') ).'"/>
<input type="hidden" name="Account_Address_1" value="'.htmlentities( ff_getSubmit ('address') ).'"/>
<input type="hidden" name="Account_City" value="'.htmlentities( ff_getSubmit ('city') ).'"/>
<input type="hidden" name="Account_State" value="'.htmlentities( ff_getSubmit ('state') ).'"/>
<input type="hidden" name="Account_Zip" value="'.htmlentities( ff_getSubmit ('zip') ).'"/>
<input type="hidden" name="RestaurantInc_Subscriber_YN" value="'.htmlentities( ff_getSubmit ('signupverification') ).'"/>
<input type="hidden" name="Pref_Offers_YN" value="'.htmlentities( ff_getSubmit ('Pref_Offers_YN') ).'"/>
<input type="hidden" name="formSourceName" value="'.htmlentities( ff_getSubmit ('formSourceName') ).'"/>
<input type="hidden" name="sp_exp" value="'.htmlentities( ff_getSubmit ('sp_exp') ).'"/>
</form>
<script>
document.signupresubmit.submit();
</script>
';

exit;


THANK YOU PAGE REDIRECT SCRIPT:

$this->execPieceByName('ff_InitLib');
JFactory::getApplication()->redirect('thank-you-restaurant-inc-sign-up');

exit;

I've tried several permutations without success. I don't know if my approach is wrong or if it's just not possible to accomplish.

Thank you.
#235728
  • Posts: 2275
  • Karma: 84
  • Thank you received: 305

mihaela replied the topic: Submit to URL and Redirect Page

Hello,

I'm not sure whether these two functionalities can work together, but can you please try to compose the scripts In End Submit pieces as follows:
$this->execPieceByName('ff_InitLib');
echo '
<form name="signupresubmit" method="post" action=" www.pages03.net/reinhartfoodservice/cont...aurantInc_SignUpPage " pageId="10912359" siteId="429019" parentPageId="10912357">
<input type="hidden" name="Customer_FirstName" value="'.htmlentities( ff_getSubmit('firstname') ).'"/>
<input type="hidden" name="Customer_LastName" value="'.htmlentities( ff_getSubmit ('lastname') ).'"/>
<input type="hidden" name="Email" value="'.htmlentities( ff_getSubmit ('email') ).'"/>
<input type="hidden" name="RestaurantOperator_Indicated_YN" value="'.htmlentities( ff_getSubmit ('restaurantoperator') ).'"/>
<input type="hidden" name="Account_Name" value="'.htmlentities( ff_getSubmit ('establishment') ).'"/>
<input type="hidden" name="Customer_Indicated_YN" value="'.htmlentities( ff_getSubmit ('reinhartcustomer') ).'"/>
<input type="hidden" name="Customer_Number_OLD" value="'.htmlentities( ff_getSubmit ('customernumber') ).'"/>
<input type="hidden" name="Pref_News_Updates_YN" value="'.htmlentities( ff_getSubmit ('moreinfo') ).'"/>
<input type="hidden" name="Account_Address_1" value="'.htmlentities( ff_getSubmit ('address') ).'"/>
<input type="hidden" name="Account_City" value="'.htmlentities( ff_getSubmit ('city') ).'"/>
<input type="hidden" name="Account_State" value="'.htmlentities( ff_getSubmit ('state') ).'"/>
<input type="hidden" name="Account_Zip" value="'.htmlentities( ff_getSubmit ('zip') ).'"/>
<input type="hidden" name="RestaurantInc_Subscriber_YN" value="'.htmlentities( ff_getSubmit ('signupverification') ).'"/>
<input type="hidden" name="Pref_Offers_YN" value="'.htmlentities( ff_getSubmit ('Pref_Offers_YN') ).'"/>
<input type="hidden" name="formSourceName" value="'.htmlentities( ff_getSubmit ('formSourceName') ).'"/>
<input type="hidden" name="sp_exp" value="'.htmlentities( ff_getSubmit ('sp_exp') ).'"/>
</form>
<script>
document.signupresubmit.submit();
JFactory::getApplication()->redirect('thank-you-restaurant-inc-sign-up');

exit;
In the code above replace 'thank-you-restaurant-inc-sign-up' with the absolute path of the page that you wish to redirect to.

Let me know whether it worked.

Regards,

Mihaela
#235752
  • newhallklein
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

newhallklein replied the topic: Submit to URL and Redirect Page

I think you're right and the two functions don't work together. This is going to the IBM/Watson CRM which has it's own (ugly) "thank you" page. I'm going to see if I can have them redirect that page back to our site (meta refresh).
Thanks!
#235779
Moderators: ForumSupporttomeperica
Time to create page: 0.035 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here