• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Text field (Forms) - highlighting the text after choosing (pressing) of the form

Community Beginner ,
Jul 18, 2022 Jul 18, 2022

Copy link to clipboard

Copied

Dear members,

 

I hope that someone will be able to help me.

 

I have created a fillabile pdf file.

 

The file contain checkboxes and also text fileds.

 

Is there any ready script with which i can highlight one of few offered text fields (or words) when i will press on one of them.

 

For instance in the pdf i have one row with this question:

 

You eat with: a spoon - a fork  - a knife

Is there a way when i will press on one of the words (spoon or fork or knife)  that word to be automaticaly highlighted with some specific color ?

 

Thanks in advance

TOPICS
How to , PDF forms

Views

690

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

Not really. First of it, it's extremely difficult finding out exactly on which word the user clicked, and also there's no way to highlight a part of a text in a form field. You can, however, change a word's text color, or underline it, for example.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

Thank you very much for your fast reply. Could you send me a script for your proposal ?thanks 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

Which part?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

I mean on this ...You can, however, change a word's text color, or underline it, for example.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

This requires setting the field as having Rich Text Formatting, and then applying the value to it using the richValue property as an array of Span objects, like this:

 

var spans = [];
var span1 = new Object();
span1.text = "a spoon - ";
spans.push(span1);
var span2 = new Object();
span2.text = "a fork";
span2.underline = true;
spans.push(span2);
var span3 = new Object();
span3.text = "  - a knife";
spans.push(span3);

this.getField("Text1").richValue = spans;

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

LATEST

many, many thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines