Copy link to clipboard
Copied
Hi - I am new with javascript and seem to be hitting a bunch of dead ends. I am trying to create a form with multiple check boxes, Based on the selection of text boxes a full letter will populate. Right now I am using scrip that looks like this
var a = this.getField("options").value;
if(a == "a"){
event.value = "Option A paragraph";
}
else if(a == "b"){
event.value = "Options B paragraph";
}
I have done this script for all 10 chck boxes and have 10 coressponding text box fields to popoulate the informaton in.
But I am now realizing that the paragraph options are all different lengths and the letter would have to be formatted each time.
Is there a script that would auto format all the paragraph spacing? or should I use one big long text box (but it would have to be multiple pages) with a long script.
Last question: can you format paragraphs with javascript ?
Thank you
1 Correct answer
The answer is yes and no.
Fields can display "Rich Text", which gives you the ability to apply some formatting options. You can test this out by setting one of your text fields to Rich Text and multi-line from the Options tab on the field properties dialog. Then use the properties toolbar to set paragraph formatting options. There are more options on the Properties toolbar than there are in JavaScript. Many of these are undocumented, so you have to experiment to see what you can get.
Display
...Copy link to clipboard
Copied
The answer is yes and no.
Fields can display "Rich Text", which gives you the ability to apply some formatting options. You can test this out by setting one of your text fields to Rich Text and multi-line from the Options tab on the field properties dialog. Then use the properties toolbar to set paragraph formatting options. There are more options on the Properties toolbar than there are in JavaScript. Many of these are undocumented, so you have to experiment to see what you can get.
Display the Properties bar with Ctrl-E. Be sure to check out the "More..." button.
Use the Acrobat JavaScript Reference early and often

