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

Help with script

New Here ,
Jun 17, 2022 Jun 17, 2022

Looking for a script that will prevent users from putting entries in both colum A and  B of fillable pdf fields. If you put something in colum A, then nothing can go in column B. Likewise, if something is in colum B, then you can't have something in column A.

TOPICS
PDF forms
906
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 ,
Jun 18, 2022 Jun 18, 2022

Those are 2 scripts, one for field "A" second for field "B". 

Script for field "A":

this.getField("B").readonly = event.value == "" ? false : true;

Script for field "B":

this.getField("A").readonly = event.value == "" ? false : true;

 

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 ,
Jun 17, 2022 Jun 17, 2022

You can set fields to readonly, lets say you have fields "A" and "B" if field "A" have value field "B" is readonly and vice versa, as validation script of:

 field "A":

this.getField("B").readonly = event.value == "" ? false : true;

field "B":

this.getField("A").readonly = event.value == "" ? false : true;

 

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 ,
Jun 18, 2022 Jun 18, 2022

Thank you for your response. I tried putting in the script, but it's giving me a syntax error message.

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 ,
Jun 18, 2022 Jun 18, 2022

Can you post script you tried to use?

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 ,
Jun 18, 2022 Jun 18, 2022

I used the script you provided, but replaced the "A" and "B" reference to my form field names.

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 ,
Jun 18, 2022 Jun 18, 2022

Those are 2 scripts, one for field "A" second for field "B". 

Script for field "A":

this.getField("B").readonly = event.value == "" ? false : true;

Script for field "B":

this.getField("A").readonly = event.value == "" ? false : true;

 

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 ,
Jun 18, 2022 Jun 18, 2022
LATEST

It worked! THANK YOU SO MUCH!!!

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