Dynamic Form Button Text based on response | Community
Skip to main content
Level 2
Oct 28, 2019 6:31 PM UTC
Solved

Dynamic Form Button Text based on response

I am working on a Marketo form and if someone checks a box to bring a guest, I would like the button to change to say "next" but if they do not check the box and do not want to bring a guest, I would like the button to just say "submit."

Is there a way to do this?

Thank you!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Oct 28, 2019 7:48 PM UTC

Yes, trivially done with JS: MktoForms2 :: Dynamic button label 

Unfortunately, the easiest way (as is in the demo) is to attach to the DOM change event, which I generally discourage. You could use a dummy Visibility Rule instead (not what Josh is suggesting, but merely using the VR to trigger a Marketo Forms API event) and which would allow you to listen for whenRendered instead of generic change.

7 replies

nmdomingAuthor
Level 2
Oct 28, 2019 8:05 PM UTC

Thank you, this is all very helpful! 

Translate
SanfordWhiteman
Level 10
Oct 28, 2019 8:32 PM UTC

OK, can you mark my answer as Correct pls, since it directly meets the original goal? Thanks.

Translate
Josh_Pickles
Level 5
Oct 28, 2019 7:33 PM UTC

Hi Nicole,

The default form tool within Marketo won't allow for this. You can likely edit the form function outside of Marketo, however, I believe you can get a similar result by using Visibility Rules.

I presume that by hitting next will take then to a new form page where they can add in the guest details? If you add the relevant fields (Guest Name, Guest Email etc) as fields underneath your "Bring a Guest" check box, you can use visibility rules on the form to hide Guest Name/Guest Email and set them to only appear once Bring a Guest has been checked.

For more information on this, check the Marketo docs here: Dynamically Toggle Visibility of a Form Field - Marketo Docs - Product Documentation 

Translate
nmdomingAuthor
Level 2
Oct 28, 2019 7:46 PM UTC

Hi Josh,

That is correct. We would like it to go to a new page with a new form so we can capture their first name, last name, email and company name in the same fields rather than having guest fields. 

Translate
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Oct 28, 2019 7:48 PM UTC

Yes, trivially done with JS: MktoForms2 :: Dynamic button label 

Unfortunately, the easiest way (as is in the demo) is to attach to the DOM change event, which I generally discourage. You could use a dummy Visibility Rule instead (not what Josh is suggesting, but merely using the VR to trigger a Marketo Forms API event) and which would allow you to listen for whenRendered instead of generic change.

Translate