Hub Hack: Rename default form field label 'Email' in Form CTA

Follow

Objective

Use this Custom Code snippet as a workaround to rename the default form field label 'Email' in a Form CTA to one of your choice.

 

Warning

Hub Hacks are not official Uberflip features.

Hub Hacks may not work on all Hubs or may cause unexpected behavior. If you experience issues with a Hub Hack, available support is limited to helping you disable the Hub Hack only.

 

Details

  • Type: JavaScript
  • Placement: Body Bottom
  • Notes: You'll need to choose the appropriate code snippet based on the version of the Uberflip Hub Front End that your Hub is using. If you're not sure which version you are on, see this article for instructions.

Code

For Front End V2 Hubs

<script> 
function updateEmailCtaLabelLoad() {

// To add another CTA, copy and paste line below and replace the CTA ID
with new CTA ID

$("section[data-id='CTA ID GOES HERE']
.uf-cta-label.uf-cta-activate-label").each(function() {
var text = $(this).text();
text = text.replace("Email", "NEW CTA LABEL NAME");
$(this).text(text);
});
}

function updateEmailCtaLabelActivate() {

// To add another CTA, copy and paste line below and replace the CTA ID
with new CTA ID

$('section[data-id="CTA ID GOES HERE"]
.uf-email-field label.uf-cta-label').text('NEW CTA LABEL NAME');
}

Hubs.Events.on('load', function(ctaId){
updateEmailCtaLabelLoad();
});
Hubs.Events.on('ctaActivate', function(ctaId){
updateEmailCtaLabelActivate();
});

</script>

 

For Front End V1 Hubs

<script>
function updateEmailCtaLabel() {

// To add another CTA, copy and paste line below and replace the CTA ID
with new CTA ID


$('div[data-cta-id="CTA ID GOES HERE"]
div.email-field span').text('NEW CTA LABEL NAME:');
}

Hubs.Events.on('load', function(ctaId){
updateEmailCtaLabel();
});
Hubs.Events.on('ctaActivate', function(ctaId){
updateEmailCtaLabel();
});

</script>

 

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.