Adding an “Other” option to Marketo forms without adding db fields

You often see Marketo forms with an “extension” field where a lead can type an explanation for their Other/None of the Above choice:

ss

This works well enough from the lead's perspective. You can use Visibility Rules to show the extension field only if Other is selected in the primary field.

But there's really no reason to do it this way. I consider this an antipattern with Marketo forms for two reasons:

  1. It wastes a field in your instance. As we know, you can't delete fields, only hide them. The field will be rarely filled in (by definition). And the more of these extension fields you create alongside primary fields, the more clutter you've got.

  2. It breaks your data model. Now, to report on your Unsubscribed Reason across the db, you always have to bring in two fields. The primary field is usually a text field in Marketo (the radio button choices just happen to be hard-coded in the Form Editor) so it can hold any text you want, including the lead-supplied “other” text. Isn't it better to just have one field holding your prefab choices and freeform entries like Other: I'm no longer in the industry and Other: I purchased from a competitor?

It's easy to accomplish the above without adding any fields to your instance.

Of course, you do need to add a <TEXTAREA>. How, you may wonder, do you add that to the form if there's no corresponding, unique field in your Marketo instance? Simple: add a Rich Text element.

ss

There's absolutely nothing that stops Rich Text HTML from containing form fields. This is how I approach a lot of client-side form enhancements: add temporary elements in RTs, query their current values on submit, and add/update Marketo fields accordingly. The flexibility is endless.

Once the RT exists you can add Visibility Rules just like you would with a separate field.

ss

Then a l'il Forms API JS pulls it all together. You can grab sample code from the Pen below. Note (as is good programming practice) there are no “magic strings” like form field names in the code. So you can use the same code without alteration (except for removing the alert() of course).