Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?