How to use the FormTitan Post Message

Last updated Jun 24 2019

This option will allow you to pass data to selected fields via POST MESSAGE option and without having to pass them in the URL and also to restrict fields and domain access.


Following are the steps to use the post message:

1- Go to: Form settings > Limits, and Turn on the 'Post Message' checkbox.


2- Configure your domain/domain list, or use * for all
3- Specify which params are allowed to get post values, configure their names.
On your script, pass the name as configured in the step above

4- If you are using IFRAME:
<script>
var sendMEssage = function(){
//ref to your formtitan IFRAME
var receiver = document.getElementById('receiver').contentWindow; //reciever is the id of the iframe
var data = JSON.stringify({name:"Nikita", age:123});
receiver.postMessage(data, 'https://post.domain.com');
}
</script>
<button onclick="sendMEssage()">send message</button>
<iframe onload="window.parent.scrollTo(0,0)" id="receiver" allowtransparency="true" src="https://post.domain.com/ftb969c76b1549353344146" frameborder="0" width="754" height="400" scrolling="no"></iframe>

If you are using Embed/Scripts
<script>
var sendMEssage = function(){
 
var div = document.getElementById('ftEmbedForm');
receiver = div.childNodes[0].contentWindow;
var data = JSON.stringify({name:"Nikita", age:123});
receiver.postMessage(data, 'https://post.domain.com');
}
</script>
<button onclick="sendMEssage()">send message</button>
<div id="ftEmbedForm"></div>

Learn more: Post a message to embedded form in Salesforce



CommentsLogin Required
Didn’t find what you were looking for?
Try the following for assistance or Use the Search box.