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
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.
Copy link to clipboard
Copied
Thank you very much for your fast reply. Could you send me a script for your proposal ?thanks
Copy link to clipboard
Copied
Which part?
Copy link to clipboard
Copied
I mean on this ...You can, however, change a word's text color, or underline it, for example.
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;
Copy link to clipboard
Copied
many, many thanks