Copy link to clipboard
Copied
I have created a fillable form that has three tear-off vouchers. There are three input fields on each voucher.
However, I want the "parent" fields on the first voucher to be editable, and the "child" fields on the other two vouchers to be read-only.
This is to avoid any user error, including accidental tabbing, typos, or deletion.
Even if HTML or Javascript is necessary, is there a way to do this?
Copy link to clipboard
Copied
You can use a simple script to do it. If the first field is called Text1 enter this code as the custom calculation script of the other fields, and set them as read-only:
event.value = this.getField("Text1").valueAsString;
Copy link to clipboard
Copied
You can use a simple script to do it. If the first field is called Text1 enter this code as the custom calculation script of the other fields, and set them as read-only:
event.value = this.getField("Text1").valueAsString;
Copy link to clipboard
Copied
It works perfectly for the first two text fields (Address, City). Thanks a lot, try67​!
However, I'm having problems using it with the last field, a phone number.
Does it make a difference if that field's Format is Special > Phone Number?
Copy link to clipboard
Copied
Yes, because the value that is being copied is not formatted. You should apply the same format to the target fields, and then it should work.
Copy link to clipboard
Copied
I've verified that all three fields are formatted the same way.
When I enter the script and click "OK", the script dialog box continues to clear it, citing an error.
Any other suggestions for troubleshooting?
Copy link to clipboard
Copied
Ah, so there's an error message... That's something different.
What does the error message say? What's your exact script?
Copy link to clipboard
Copied
It doesn't deliver an error message - it simply clears the box where the script is entered, thus the script itself is not saved.
This is the script I'm using for the children - the parent is "Telephone".
event.value = this.getField("Telephone").valueAsString;
Copy link to clipboard
Copied
Are you entering it as a custom calculation script?
Copy link to clipboard
Copied
Yessir.
Copy link to clipboard
Copied
Strange... Try deleting the field and creating a new one.
Copy link to clipboard
Copied
That worked. Thank you for your help!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now