Skip to main content
Sep 4, 2014 4:24 PM UTC
Solved

Change the text on the submit button

I have a master form that I use for multiple landing pages. Is there a way to change the submit button's text just for that specific landing page? Is there a script or code that I can drop onto the landing page that will do this?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Kristin_Carideo
Kristin_CarideoAccepted solution
Level 2
Sep 4, 2014 4:41 PM UTC
You can certainly use a token, and then put the tokens in the individual programs containing your landing pages. I use {{my.FormCTA}} as my form submit button token and then just add that token to the program so I can make the button say "Learn More!" or "Sign Up!" or whatever.

15 replies

Kristin_Carideo
Kristin_CarideoAccepted solution
Level 2
Sep 4, 2014 4:41 PM UTC
You can certainly use a token, and then put the tokens in the individual programs containing your landing pages. I use {{my.FormCTA}} as my form submit button token and then just add that token to the program so I can make the button say "Learn More!" or "Sign Up!" or whatever.
Translate
Level 3
Jun 10, 2022 5:27 PM UTC

Can we add more than one token to the Form CTA in the form level? I have 2 LPs in the same program and they both are using the same form but the CTA has to be different. How can I execute this properly?

Translate
Darshil_Shah1
Adobe Champion, Community Advisor, UG Leader
Adobe Champion, Community Advisor, UG Leader
Jun 10, 2022 5:45 PM UTC

A thought - Instead of making changes in the global form to accomodate this case, wouldn't it make more sense to hard-code/overwrite the submit button lable using JS in both the LPs for this program?

 

Translate
Sep 4, 2014 5:10 PM UTC
Thank you! Works great!!
Translate
Jan 30, 2015 11:12 PM UTC
Hey all -- Does this work with embedded forms? Trying to figure out how it would and not having much luck. 
Translate
Aug 18, 2015 6:45 PM UTC

FYI we ended up adding this script to embedded forms and are able to change the submit button text easily on a per page basis, regardless of if the form is the same on every page or not.

<script src="//app-sjl.marketo.com/js/forms2/js/forms2.min.js"></script>

<form id="mktoForm_1674"></form>

<script>

    MktoForms2.onFormRender(

    function(form) {

        var loc = document.createElement('a'); // new Location object for easier parsing

        loc.href = document.referrer;

        document.querySelector('.mktoButton').innerText = "Download"

            decodeURIComponent( loc.search.substring(1) ); // use the whole query string as button label, this is just a demo

    });

   

    MktoForms2.loadForm("//app-sj01.marketo.com", "142-FNO-891", 1674);

</script>

Translate
May 20, 2015 11:08 PM UTC

So I get the program token, what token do I use in the form for the submit button label?  Is there a default value I can add as well?

Translate
SanfordWhiteman
User Group Leader
User Group Leader
May 21, 2015 12:04 AM UTC

It's the same token... not sure if I understand your question. In @Kristin Carideo​'s answer she uses {{my.FormCTA}}. 

Also note you can pass the submit button text in the URL, like in this old chestnut: CodePen - MktoForms2 :: Language

Translate
Justin_Cooperm2
Level 10
Aug 19, 2015 12:31 AM UTC

If you don't want to use a token, you can use Forms JS in an even simpler way to achieve this (either on external page or in a Marketo landing page):

<script>

MktoForms2.whenRendered(function (form){

  form.getFormElem()

  .find('button.mktoButton')

  .html('New button text');

});

</script>

Translate