Skip to main content
Inspiring
December 4, 2020
해결됨

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

  • December 4, 2020
  • 1 답변
  • 548 조회

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!

이 주제는 답변이 닫혔습니다.
최고의 답변: staceym73714452

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;
}

1 답변

Inspiring
December 7, 2020

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;
}

staceym73714452작성자답변
Inspiring
December 7, 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;
}