Skip to main content
Participating Frequently
October 13, 2021
Question

Javascripting

  • October 13, 2021
  • 2 replies
  • 996 views

A frustrated novice. If I have 4 checkbox choices on one page, how can I have the choice show up as text on another page textbox. Any help would be much appreciated.

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
October 14, 2021

which action should I choose, on mouse up, mouse enter, etc.? I am not sure which to use.

You must read this:

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/Acro12_MasterBook/JS_API_AcroJS/Form_event_processing.htm?rhhlterm=event%20processing&rhsyns=%20

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
October 13, 2021

Did you set choice as export value of checkbox?

Is there one text field for all four checkboxes, is only one checkbox checked at a time?

Participating Frequently
October 13, 2021

I haven't set any export values for the checkboxes. I am hoping to only have 1 text field show the choice selected from the 4 checkboxes.  The 4 checkboxes are ratings. Unmet, Meets, Exceeds, etc. and would like whatever choice is picked to show up on a summary page. 

try67
Community Expert
Community Expert
October 13, 2021

Do the check-boxes share the same name? If not, the user could select more than one value, and then you would need to combine all the selected values into the text field (which is possible, but probably not what you want). If they share the same name then apply the desired texts as their export values (under Properties, Options tab) and use the following code as the text field's custom calculation script (let's say the name of the check-box group is "CB1"):

 

var v = this.getField("CB1").valueAsString;

event.value = (v=="Off") ? "" : v;