I have a script which gets the values from the form loaded via JSP to another form from Marketo (as a background form submission).
So far the script is working for values like FirstName and LastName, but when I am trying to pass the values from checkboxes it throws Input Invalid Error Msg from Marketo
.
I think, the method I am using is not the right way to pass the values from Salutation Field shown in code.
mktoForm.addHiddenFields({
"Salutation": customForm.querySelector("#mwf8322014b47ad_Frau:checked").value,
"Salutation": customForm.querySelector("#mwf8322014b47ad_Herr:checked").value,
"Salutation": customForm.querySelector("#mwf8322014b47ad_Divers:checked").value,
"FirstName": customForm.querySelector("#firstname-e9ff1bfe-1321-4a89-9d13-96f9a01648fb").value,
"LastName": customForm.querySelector("#lastname-e9ff1bfe-1321-4a89-9d13-96f9a01648fb").value,
.....rest of the fields
I think, the error is because of the second and third Salutation fields which will have null values if I check the Salutation field one.
But I don't know how to pass the values.