Dynamic content in forms

Edit: Please read the edits below the post first.

I’ve been playing around with this attempting to customize the button’s Action, but I think I might be missing something.


I believe, after research, the following script would go in a custom embed (creating a button)…

Note that my desired CSS button classes are as follows:


Then in custom code for the Collection Template page I believe I need to insert the following…

<script>
function submitButton() {
    document.getElementById("email-form").submit();
}
</script>

Note that my form id is follows:


Now… I’ve done all of this, but am experiencing issues getting it to POST appropriately. The embedded button resembles the original form button I had before and even initiates some sort of submission, but something is mismatched somewhere because my form content isn’t making it to Pardot.

Any and all additional insight into this issue would be appreciated (from anyone). Thanks again.

Best,
Christopher

EDIT: Wooo it works! The issue was that my form field names were not exactly aligned with the External Field Names in Pardot. All the code in my post is correct so feel free to try building custom methods based on the above. Also, if anyone ever comes across this post and wants to know how to get a POST or GET method to work with a custom action link, just tag @ctraver2 and I’ll help you through it. :slight_smile: :100:

EDIT 2: Does not work as well as I thought! The 2.0 tutorial (with working fixes) of this can be found right here.

2 Likes