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

If Then Statement When Checking Either Yes or No to Questions Displays a Message

Community Beginner ,
Oct 31, 2023 Oct 31, 2023

Hi there, I'm hoping to get a little help. I stink at script, so please explain it to me like I'm 5, lol. I have a checklist and I want a message to appear when either yes or no are checked for each question. For example:

Question 1? “No” is checked

I'd like this message “Must be Submitted to ABC for Immediate Review” to appear.

I'm going to be using the same formula for other questions where “Yes” is selected as well.

Melissa25399267j1b4_1-1698776446033.png

Another option may be to change the color of the check mark or the checkbox, if that option requires the message. I hope I'm explaining clearly and appreciate your help! 

 

 

 

 

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , PDF , PDF forms
592
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 ,
Oct 31, 2023 Oct 31, 2023

You can use text field to show message, let's say your checkbox is named "Question 1" and it has export values of "Yes" for first checkbox and export value of "No" for second checkbox, you can use this as 'Custom calculation script' of text field:

var Q1 = this.getField("Question 1").valueAsString;

if(Q1 === "Yes")
event.value = "Message for 'Yes'";

else if(Q1 === "No")
event.value = "Message for 'No'";

else
event.value = "";

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 Beginner ,
Nov 01, 2023 Nov 01, 2023
LATEST

I can't seem to get it to work because it's a checkbox :-(.

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