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

Question

Question

Add a font-color edit to the RTF

asked on March 9, 2021

Hi all,

Using a RTF in my Form, I wish to change the font color. But the actually RTF doesn't have font-color.

How can I add this to the rtoolbar?

 

Thanks in advance.

Regards

0 0

Replies

replied on March 9, 2021

I'm on version 10.2, so I don't have the RTF elements yet, but here's how I do it with a multi-line field.  You might be able to adapt this to work with an RTF field.

Add this Custom HTML element to the form:

<label>Select Font Color:</label><br><input type="color" id="colorPicker">

 

Make the multi-line field include CSS Class Name of myTextBox.

Add this Javascript to the form: 

$(document).ready(function () {

  $('#colorPicker').change(function() {
    $('.myTextBox textarea').css('color', $(this).val() + '!important');
  });

});

 

 

Of course, this is just for displaying it to the user when the color is picked - if you want to carry it over to the archive/read-only version, you would need to store the color in a LFForms field that could be retrieved and updated when the form is reloaded.

0 0
replied on March 10, 2021

Hi Matthew,

 

Thanks for the help.

I need to set the font color only for few words, not all the textarea.

 

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

Sign in to reply to this post.