You are viewing limited content. For full access, please sign in.

Question

Question

Font size of custom link in Modern Designer

asked on March 4, 2024

So I have a customer html field in a modern form.  This is essentially a link that the user clicks on that opens up a WebAccess URL .  Here is the code and it is working fine.

window.clickStartTimerButton = function () {
 
};


var link = LFForm.getFieldValues({fieldId: 27});

LFForm.changeFieldSettings(
    { fieldId: 10 },
    { content: "<a href='"+link+"' target=\"_blank\">View Contract</a>" }
  );

 

However, Id like to make this bigger.  I have tried various iterations of code for font size and everything either does not work or it breaks the link. 

I update the code to the following with the font size attribute

window.clickStartTimerButton = function () {
 
};

var link = LFForm.getFieldValues({fieldId: 27});

LFForm.changeFieldSettings(
    { fieldId: 10 },
   { content: "<a href='"+link+"' target=\"_blank\" style="font-size: 50px;">View Contract</a>" }
  );

As you can see that breaks the link:

 

Any ideas as to what syntax is used so we can modify the front size?

 

Thanks,

Chris

0 0

Answer

APPROVED ANSWER SELECTED ANSWER
replied on March 5, 2024

It looks like your issue is combining quotes. it is best practice to use double quotes " in html string. To make this easier to work with in JS you can use ` quotes to encapsulate the entire string and the ${variableName} syntax to inject variables into the strings. this way you dont have to worry about escaping any of your quotations. See below:

 

window.clickStartTimerButton = function () {};

var link = LFForm.getFieldValues({ fieldId: 27 });

LFForm.changeFieldSettings(
  { fieldId: 10 },
  {
    content: `<a href="${link}" target="_blank" style="font-size: 50px;">View Contract</a>`,
  }
);

 

4 0
replied on March 11, 2024

Thanks Zach, much appreciated.  This looks to have done the trick.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.