Skip to main content
Participating Frequently
March 28, 2019
Question

using checkbox to fill out form field

  • March 28, 2019
  • 2 replies
  • 465 views

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;

This topic has been closed for replies.

2 replies

Lukas Engqvist
Community Expert
Community Expert
April 1, 2019

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?

try67
Community Expert
Community Expert
March 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.