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

conditional readonly signature field

Community Beginner ,
Jul 25, 2019 Jul 25, 2019

Copy link to clipboard

Copied

in my digital forms using pdf expert on ipad

i have ( submit by email ) button with mailDoc, mouse up run JavaScript action

i added another mouse up action

if(this.getField("CAP1Signature").value !=""){

this.getField("CAP1Signature").readonly = true;

}

////

if(this.getField("CAP1Signature").value =""){

this.getField("CAP1Signature").readonly = false;

}

to make the a signature field is readonly if the field is already signed

and (not) if the field is still blank

to ensure that the file will send with readonly signature

and also make a chance for the user if he forgot to sign before click on the button

my script is working half or the other half

i tried also

if(this.getField("CAP1Signature").value !=""){

this.getField("CAP1Signature").readonly = true;

}else{this.getField("CAP1Signature").readonly = false;}

i got the same result

any help please !?

thank you in advance

TOPICS
Acrobat SDK and JavaScript , Windows

Views

421

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 , Jul 26, 2019 Jul 26, 2019

In the former code you've made a classic error of using the wrong operator in your if-condition. You've used "=", which assigns a value, instead of "==", which compares two values.

The second code is better, but the question is, where did you place it?

Likes

Translate

Translate
Community Expert ,
Jul 26, 2019 Jul 26, 2019

Copy link to clipboard

Copied

In the former code you've made a classic error of using the wrong operator in your if-condition. You've used "=", which assigns a value, instead of "==", which compares two values.

The second code is better, but the question is, where did you place it?

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 Beginner ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

mouse up run a JavaScript action

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 Beginner ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

in the button

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 Beginner ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

if(this.getField("CAP1Signature").value !=""){

this.getField("CAP1Signature").readonly == true;

}else{this.getField("CAP1Signature").readonly == false;}

I correct the script but i got the same result

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 ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

LATEST

Change both instances of "==" to "=" (no quotes).

On Sat, Jul 27, 2019, 13:24 almasriaa54428630 <forums_noreply@adobe.com>

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