-5

I have an html web form on a WordPress page that posts to a Cloud AMPscript submission page. When the form is submitted, it redirects the user off the WordPress page to the Cloud Submission Page.

Is there an AMPscript I can add to the form submission page to prevent the redirect and instead show the Thank You message on the same page?

1 Answer 1

5

This is not a salesforce question. This is a question purely based on web technology. The fast answer: your web form has an attribute called target, this can be self or blank or ... . self will display in the same frame. You can also develop javascript that takes the action and handles it inside javascript. this can be done with an eventhandler that uses preventDefault.

Just use JavaScript / Ajax / JQuery or stuff like this for these kind of things.

5
  • This is a SF MC question. Your response was not helpful. Commented Sep 5, 2019 at 6:24
  • It is not. Your scenario can be described with any page which is not based on salesforce and nothing would change. Commented Sep 5, 2019 at 6:26
  • Marketing Cloud does not allow the target function on an html form that goes through a submission page Commented Sep 5, 2019 at 6:29
  • 3
    The problem here is not really what Marketing Cloud and can't do - the real problem here is the HTML of your web form. When a form has a defined action as a different website, it will go to that website. To do what you described you need two things: 1. A Marketing Cloud Cloud Page that is able to read data that is being sent to it by your form without the user needing to fill anything (via the HTTP Post Protocol). 2. As Johannes said, you need some code that is run on your webpage like "Javascript / Ajax / jQuery" that sends the information from your form to that Cloud Page without redirecting Commented Sep 5, 2019 at 6:43
  • 3
    Your question is indeed off-topic for this forum, as it is more related to HTML and web development in general and less to Salesforce. I'm 100% with @JohannesSchapdick on that one. Before your questions gets closed for being off topic, let me give you a pointer to a solution. You should be looking into AJAX form submit on the page hosting the form: stackoverflow.com/questions/1960240/jquery-ajax-submit-form Commented Sep 5, 2019 at 6:58

Not the answer you're looking for? Browse other questions tagged .