SOLVED

Re: Dynamic Form Button Text based on response

Go to solution
Nicole_Domingu1
Level 1

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!

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic Form Button Text based on response

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.

View solution in original post

7 REPLIES 7
Josh_Pickles
Level 7

Re: Dynamic Form Button Text based on response

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 

Nicole_Domingu1
Level 1

Re: Dynamic Form Button Text based on response

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. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic Form Button Text based on response

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.

Josh_Pickles
Level 7

Re: Dynamic Form Button Text based on response

Hi Nicole,

Is this so you have a new lead record created in your account for the guest? There are some problems with this - mainly that the guest never actively opted into receive your communications about the event. I suggest instead of redirecting leads to a new form where they can submit guest details that you include forward to a friend variables within the email - or social sharing options on the registration landing page - so the guest can register themselves.

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic Form Button Text based on response

Forward to friend also doesn't involve an opt-in to the initial e-mail. It sets new leads to Unsubscribed=true but nevertheless sends them the email. (As you can do with a referral form, depending on jurisdiction.)

Nicole_Domingu1
Level 1

Re: Dynamic Form Button Text based on response

Thank you, this is all very helpful! 

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic Form Button Text based on response

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