Skip to main content
GrDz17
Participating Frequently
Mar 22, 2018 6:47 PM UTC
Answered

Fillable Form - Duplicate Fields & Read-Only

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?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Mar 22, 2018 8:57 PM UTC

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;

10 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Mar 22, 2018 8:57 PM UTC

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;

Translate
GrDz17
GrDz17Author
Participating Frequently
Mar 22, 2018 9:29 PM UTC

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?

Translate
try67
Community Expert
Community Expert
Mar 22, 2018 10:14 PM UTC

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.

Translate