Re: Override the Submit button text in Forms

Yash
Level 4

Override the Submit button text in Forms

I am wondering if there is a way to override the Submit button's text value(it is reading as 'Submit' and needs to be updated to 'Get Started'). Currently the form is being referenced across multiple landing pages so I cannot change the value in the form itself but need to override it in the current landing page. Please advise, thanks.

4 REPLIES 4
JD_Nelson
Level 10 - Community Advisor

Re: Override the Submit button text in Forms

There might be a more efficient way, but this should work:

<script>
MktoForms2.whenRendered(function (form){
  form.getFormElem()
  .find('button.mktoButton')
  .html('BUTTON NAME');
});
</script>

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Override the Submit button text in Forms

In this particular case, unless the label is also going to change when VRs fire, it's okay to use whenReady rather than whenRendered (as the button will always be in the DOM on ready).

Dhriti
Level 1

Re: Override the Submit button text in Forms

Hi,

 

I tried this with the following code:

MktoForms2.whenReady(function (form){
$(".mktoButton"). html("Get Started");
});

Hope it will help.

 

Thanks

SanfordWhiteman
Level 10 - Community Moderator

Re: Override the Submit button text in Forms

This code isn't correct. You only want children of the current form element, like in JD's example, not the entire document.