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

using checkbox to fill out form field

New Here ,
Mar 27, 2019 Mar 27, 2019

I have a checkbox that if selected on the first PDF page it uses text from another hidden text form field and saves it as read only when checked.I still want the user to be able to unchecked the box and fill data in if needed.Everything is working fine on the first form field but the second field is not working. Below is the script and an what im trying to do.

Check Box

H_SERIAL_NA_CHECKBOX

First text form field (When "H_SERIAL_NA_CHECKBOX" is selected the value "N/A" needs to be added to the field and set to read only, But when unchecked the user is able to change the value if needed)

SERIAL_2

Second text form field (When "H_SERIAL_NA_CHECKBOX" is selected the value "N/A" needs to be added to the field and set to read only, But when unchecked the user is able to change the value if needed)

SERIAL_1

Custom Calculation Field in "SERIAL_2" and "SERIAL_1"

event.value = this.getField("H_SERIAL_NA").value;

event.rc = this.getField("H_SERIAL_NA_CHECKBOX").isBoxChecked(0);

event.target.readonly = event.rc;

event.value = this.getField("H_SERIAL_NA").value;

event.rc = this.getField("H_SERIAL_NA_CHECKBOX").isBoxChecked(0);

event.target.readonly = event.rc;

checkbox.JPG

checkbox 1.JPGserial.JPG

TOPICS
Acrobat SDK and JavaScript
412
Translate
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 ,
Mar 29, 2019 Mar 29, 2019

Instead of doing it like that you should do it from the MouseUp event of the check-box field, setting the value and read-only properties of the text field based on its value.

Translate
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 ,
Apr 01, 2019 Apr 01, 2019
LATEST

I think you will need to have unique names for the checkboxes and fields. From your code you have the same name for both instances?

Translate
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