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

Help with script

New Here ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

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

Views

76

Likes

Translate

Translate

Report

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

correct answers 1 Correct answer

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;

 

Likes

Translate

Translate
Community Expert ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

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;

 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Can you post script you tried to use?

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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;

 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

It worked! THANK YOU SO MUCH!!!

Likes

Translate

Translate

Report

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