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

Fillable Form - Duplicate Fields & Read-Only

New Here ,
Mar 22, 2018 Mar 22, 2018

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?

TOPICS
PDF forms
3.4K
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
1 ACCEPTED SOLUTION
Community Expert ,
Mar 22, 2018 Mar 22, 2018

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;

View solution in original post

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 22, 2018 Mar 22, 2018

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
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
New Here ,
Mar 22, 2018 Mar 22, 2018

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
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 22, 2018 Mar 22, 2018

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
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
New Here ,
Mar 23, 2018 Mar 23, 2018

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?

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 23, 2018 Mar 23, 2018

Ah, so there's an error message... That's something different.

What does the error message say? What's your exact script?

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
New Here ,
Mar 23, 2018 Mar 23, 2018

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;

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 23, 2018 Mar 23, 2018

Are you entering it as a custom calculation script?

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
New Here ,
Mar 23, 2018 Mar 23, 2018

Yessir.

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 23, 2018 Mar 23, 2018

Strange... Try deleting the field and creating a new one.

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
New Here ,
Mar 23, 2018 Mar 23, 2018
LATEST

That worked. Thank you for your help!

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