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

Make a alternate buttons appear depending if signature field is filled or not

Explorer ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

The form has to be submitted to two levels so a new button appears for submitting to the next level. One the form is in the level 2 and level 3 state a "Denied" button appears where these two levels could deny the form and signature fields and submit buttons for level 2 and 3 completely disappear. I also have a "Undo Denied" button incase it is clicked by mistake to make everything reappear.

 

Currently this when clicking "Undo Denied" this makes both level 2 and level 3 approval buttons appear which I only want one of them to appear dependinf on if the level two signature is already entered or not.

If level two has already signed it then the level 3 submit button needs to be visible, but if the level two signature is not yet signed then the level 2's button needs to be visible instead.

 

Level 2's button is called: Submit_to_Director

Level 3's button is called: Director_Approved

and Level 2's signature is: Manager_Signature

 

I've written this, but I'm certain it's incomplete or correct.

 

if
this.getField("Manager_Signature")==True
then this.getField("Director_Approved").display = display.visible;
else
this.getField("Submit_to_Director").display = display.visible;

 

Please advise. Thank you!

TOPICS
Acrobat SDK and JavaScript

Views

268

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

Explorer , Dec 07, 2020 Dec 07, 2020

Woohoo! Figured it out. Here is the answer for anyone that needs it in the future.

 

if (this.getField("Manager_Signature").value.length == 0){
this.getField("Submit_to_Director").display = display.visible;
} else {
this.getField("Director_Approved").display = display.visible;
}

Votes

Translate

Translate
Explorer ,
Dec 07, 2020 Dec 07, 2020

Copy link to clipboard

Copied

I've figured out the syntax I was missing, but it's still not working. I'm almost certain it's the "True" statement. I found posts about doing this with checkboxes, but not with a signature field.

 

if  (this.getField("Manager_Signature")==True){
this.getField("Director_Approved").display = display.visible;
} else {
this.getField("Submit_to_Director").display = display.visible;
}

Votes

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
Explorer ,
Dec 07, 2020 Dec 07, 2020

Copy link to clipboard

Copied

LATEST

Woohoo! Figured it out. Here is the answer for anyone that needs it in the future.

 

if (this.getField("Manager_Signature").value.length == 0){
this.getField("Submit_to_Director").display = display.visible;
} else {
this.getField("Director_Approved").display = display.visible;
}

Votes

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