Submitting Custom Form/Updating Lead

Not applicable

Submitting Custom Form/Updating Lead

I'm currently trying to implement a Marketo form with some custom logic for being progressive.

The problem is, I'm trying to do this in Sitecore. Sitecore wraps their entire page in a form already, which makes using Forms 2.0 impossible (as far as I can tell), since you can't have nested forms. So right now I'm just using html and javascript to make my form.

What I currently have working...

1) I have Munchkin code on my page

2) The page can make a REST call to Marketo with a LeadId, and based on the returned values is decided what fields to show, and it prefills them if data already exists.

What I need to do...

1) Submit the fields back to Marketo. I have the ID of the Form in Marketo, if there is a way to get around the nested <forms> and submit.

2) Updating the Lead directly would work, however I'm not sure how to create a new Lead using just the Munchkin cookie code. I've figured out how to use filter types to see if a Lead already exists for the Munchkin code, but not how to create a new Lead on submit.

Any help or suggestions would be appreciated.

Level 10 - Community Moderator

Re: Submitting Custom Form/Updating Lead

You're on the wrong track. If you can "use HTML and JavaScript" to make your form, then you can insert a Marketo Forms 2.0 embedded form in exactly the same location.  There's no difference in nesting rules between a "plain" HTML form and the HTML fragment that is injected by the Forms 2.0 library.  It's true that you can't have <FORM><FORM> -- but that same rule applies to you. If the whole page is actually wrapped in a giant <FORM> (a terrible design) then everything is impacted.

Using the REST API is neither advisable nor necessary here, as Marketo forms natively support Progressive Profiling.  You should never use the REST API in response to individual end-user actions.

Please post a link to a sample Sitecore page withoiut the form and where you want to insert the Forms 2.0 <FORM>.  I'll show you how it's done.