@marianoadunseco wrote:
I see @darshil_shah1 . So in the example, you provided, the "FA's Email" populates to a hidden form field (on the same form) when the form is submitted to the visible form field value that corresponds to it (in the hidden field)? Just so I'm understanding this correctly (I believe I am but would like to verify).
In Sandy's script the "FA's Email" field's value is not appended to any hidden field during the referrer's form submission (i.e., during the form submission 1), but this can be easily done with the formObject.setValues() function (we would need the API name of the field(s) to which the referee's email and/or other details need to be added during referrer form submission).
In which case, If I needed to add a First Name, Last Name, Country and Company for the referee, I would need to do this:
'Email': originalValues['Email_Address_2__c'],
'FirstName': OriginalValues['Email_Address_2__c'],
'ComapnyName': OriginalValues['Email_Address_2__c'],
You need to replace the 'Email_Address_2__c' with the actual fields' API names being used in the form - you can find the API names of the fields from the field management, read about it here.
Finally, I'm a little in the dark about this other aspect of the script... What do these numbers need to be populated with?:
MktoForms2.loadForm("//app-sj01.marketo.com", "410-XOR-673", 441);
Well, these are not just random characters - these are the baseUrl, munchkinId, and formId, respectively you can look for these values in the Embed Form code - go to Marketo > Navigate to and select the Marketo form you're gonna use for this project > Select Form Actions in the right Pane > Click on the Embed Code - A dialog box will appear with the script to embed the form - this script will have MktoForms2.loadForm("<baseUrl>", "<MunchkinId>", <formId>) - you need to plug values you see here into the actual script.
And apologies to ask another set of questions - but what other aspects of the script need to be customised with values unique to your own form and LP?
Is that correct? And I'd assume the scripts would sit at layout template level...
This is a starter script with the recipe for the multiple form submissions, clearing cookies after first submission, assigning apt referrer and referee data during each of the form submissions - you need to update the API names of the fields you're using in the form, instance base URL, munchkin-id, form-id, and the form-js script address.
This can be added at the LP/webpage level unless all the LPs you're gonna create from the template need to reference this script.