One form, One submission button, but TWO actions

后端 未结 5 779
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 05:44

I have a form that collects client\'s info and then it

  • saves them in the database
  • sends out few emails
  • sends the info to SalesForce (SF) depar
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 06:18

    Once a form is submitted, you are no longer on that page. You've navigated away.

    The other way you can do this is submit the first action via AJAX, then submit the form naturally to the second destination. I would suggest using jQuery to make your AJAX calls since most of the AJAX code is already there for you to use.

    Another option is to have raf-submitted.php perform a POST from your server to the salesforce server once it receives the form data. See: Post to another page within a PHP script

提交回复
热议问题