Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

How to properly handle form submission

How to properly handle form submission

On many occasions when handling any form submission single cloud page application is used. This is great as all of error handling, form submission and processing is on one page so it is actually simpler to implement. But here are some thing you need to take into consideration.

Handle GET form submissions

I have seen lots of cloud pages made in a way that i could easily submit the form via the get request.

%%[
SET @submit =  RequestParameter("submit")
IF  NOT EMPTY(@submit) THEN
	//process the form
END IF
]%%

You can easily submit the form with the url parameters:

example.com?submit=22

This can be avoided by asking if the request is POST

<script runat="server">
    Platform.Load("core","1.1.1");
    Variable.SetValue('@request', Platform.Request.Method);
</script>
%%[
SET @submit =  RequestParameter("submit")
IF  NOT EMPTY(@submit) AND @request == "POAST" THEN
	//process the form
END IF
]%%

Accidental form resubmission

When form is processed you want to show user that the information has been successfully saved. You somehow refresh the page and resubmit the form again. This can be easily solved by redirecting user after form has been successfully saved to another success cloud page

SET @successPage = 333 //success page id
IF  NOT EMPTY(@submit) AND @request == "POAST" THEN
	//process the form
	Redirect(CloudPagesURL(@successPage, 'param','value')) 
END IF

Another possible enhancements that can be done to our cloud page form submission is to add recaptcha

Oh hi there 👋
I have a FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

We don’t spam! Read our privacy policy for more info.

Marcel Szimonisz
Marcel Szimonisz
MarTech consultant As a marketing automation consultant, I specialize in problem-solving, process automation, and driving innovation for clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified), as well as 1x Salesforce Associate certified.

Moreover, I serve as a community advisor for Adobe Campaign, providing expert insights and guidance.

Beyond my professional pursuits, I explore various programming languages, CMSs, and frameworks, enhancing my technical expertise and staying at the forefront of industry advancements.
Take a look at our subscription offering in case you are looking for a Marketing Automation Consultant.

Leave a comment

Your email address will not be published. Required fields are marked *

Similar posts that you may find useful

The image is a wide-format representation of a modern coding environment, specifically focused on the latest ES6 JavaScript features. It prominently displays a computer screen with a code editor, where JavaScript code is shown with highlights on ES6 features such as arrow functions, classes, and template literals. The code is adorned with vibrant syntax highlighting, making elements like code brackets and semi-colons stand out, emphasizing the JavaScript language. The background is infused with digital and technological elements like binary code patterns and abstract tech-inspired graphics, symbolizing innovation in coding. The overall color scheme is dynamic and lively, reflecting the advanced and cutting-edge nature of ES6 in the realm of web development.
Adobe Campaign, Marketing Automation

Enable newest ES6 JavaScript features

2 minutes read

You may have noticed, when working with the tool for some time, that the JavaScript used around the Adobe Campaign Classic platform is not the newest version. Adobe Campaign Classic relies on ES5 JavaScript, released in 2012. This may cause some first world problems for those accustomed to modern features like Array.indexOf, Array.find, classes, object […]

Continue reading
Adobe Campaign Classic Incrememental query
Adobe Campaign, Marketing Automation

Incremental query activity: All you need to know

2 minutes read

Adobe Campaign Classic provides a range of activities that allow you to query data from your database. Today we will take a look at the incremental query, which allows you to periodically select a target based on a specific criteria, while excluding individuals who have already been already targeted. The population that has already been […]

Continue reading
Adobe campaign tips and tricks
ACC Tips & Tricks, Adobe Campaign

How To Convert Base64 to PDF attachment

1 minute read

In this article, I will provide a simple trick for converting Base64 encoded data to PDF using JSAPI in Adobe Campaign Classic. Due to AC’s inability to attach Base64-encoded files directly to emails, this method can prove to be highly useful. Base64 data format that would be easy to use when supperted by Adobe Campaign […]

Continue reading
Salesforce Marketing Cloud Tips
Journey builder, Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Refresh Delivery in Transactional Journey

1 minute read

The process might seem straightforward at first glance—simply refreshing the email delivery content in Salesforce Marketing Cloud should suffice to receive the updated email contents. However, there’s more to consider. Salesforce Marketing Cloud utilizes server-side caching, which may display outdated content. Understanding when the cache refreshes isn’t always clear. In scenarios where immediate changes are […]

Continue reading
Queries in SSJS and AMPScript
Marketing Automation, Salesforce Marketing Cloud

Query data extensions with SSJS and AMPScript

1 minute read

There’s another topic for which official documentation often lacks sufficient information, but it can be incredibly useful when needed. It’s important to note that in AMPScript, we use the data extension name to reference the table for any query. On the other hand, in SSJS, we utilize the data extension’s external key to reference the […]

Continue reading