I'm trying to us an external URL as the confirmation for a form submission, and I'm trying to both retrieve and push some values in the URL to another page on Submit (if that makes any sense at all). Reason being, we have an external agency helping us out with some sales calls. We have to keep track of which sales agent leads to which conversions, and I'm trying to push a Customer ID number in the URL so that the sales agents won't have the opportunity to fat-finger it potentially.
The sales agent will have access to the landing page with the form that I supply to them, the customer's first name, last name, and email (and obviously phone), and that's it. We're still unsure if we'll also be passing along the customer ID numbers. But at the least, the customer ID numbers are stored in Marketo (which the sales agents won't have access to). The idea is to then, on form submission, link to an external URL and push within the URL some UTMs as well as the values on the form, and retrieve and push the Customer ID number.
My URL structure is: https://mywebsite.com/?email={lead.Email}&CustomerID={lead.CustomerID}&utm_source=form&{lead.AgentNumber} and I've put that into the External URL box on form submission as {my.SubmissionURL} I can't figure out the syntax for the onSubmit java JavaScript function, though, to retrieve and pass the values I need (if possible), and I'm not even quite sure where the extra JavaScript goes (in the embed script for the form to go on a landing page?). Here's what I'm trying to work with:
MktoForms2.loadForm("//app-ab00.marketo.com", "785-UHP-775", 1057, function(form) {
form.onSubmit(function(){
// Get the form field values
var vals = form.vals(NOT SURE WHAT TO PUT HERE OR WHAT SYNTAX TO USE);
alert("Submitted values: " + JSON.stringify(vals)); //not sure what this line means, but it was in the Forms 2.0 documentation
});
});
Any help figuring this out would be great!
... View more