I've been asked to create two forms that can toggle between each other. There is a block of rich text instruction at the top of each of the two forms that when clicked, currently loads a Marketo landing page that holds each form, just for demonstration purposes. Our company web team is ready to put the forms on a non-Marketo page, loading them into a modal. So you click a contact button, which pulls up one of the forms in a modal. If you decide that you actually need to fill out the other form (based on that line of rich text instruction), you would click the link in that line of instruction to load the other Marketo form into the modal. Is there any way to do this from the form itself, or does the dev team need to code that on the non-Marketo landing page? I had suggested that we not put that line of instruction at the top of the forms...that the dev team should code that outside of the form, within the modal....but they insisted that I add the instruction to the form itself. Can anyone offer any guidance here?
You can add the script to the Rich Text area (I disagree with Jamie, as this is possible). That doesn't necessarily mean you should, since that can make it harder to duplicate the same functionality in other scenarios.
I think you can achieve what you need with conditional visibility - Instead of having two forms, have just one form with a hidden field that will toggle the visibility of what is shown on one form or the other. You would control the hidden field from a script within the instruction area on top.
Once the form was submitted, you would know which version was used based on the value of the hidden field.
Good point -- but I was assuming there was already an established workflow with two different forms (distinct Filled out Form activities, etc.). Actually, you don't even need a hidden field if you don't want one. A CSS class + some (CSS) visibility rules + updating the document hash is enough to track different form "modes."
Using the hash to save the extra field is interesting, although I would prefer to use the Marketo native features for visibility control so that users can maintain the form.