Expand my Community achievements bar.

SOLVED

Dropdown List Value Test For Null || " "

Avatar

Level 5

     I wrote a pre-sign script to test a for a value in a dropdown list before allowing signature of the document. However I want to test for a value of null in addtion to one space aka " ". I added a value in the dropdown list of " " along with the choices of names so users could erase an accidental selection in this list before they were ready. However when I place the or ( || ) operator in the if statement of the script the script doesn't work. If I remove the || " " statement the script works as it is supposed to. How do I test for this value of " " along with the null test so I don't have to write another if statement?

if (form1.Page3.Author.Reviewed.Admin.rawValue == null || " ")

{

xfa.event.cancelAction = 1

xfa.host.messageBox("You did not select your name on the dropdown list before trying sign the document .");

}

else

{}

;

1 Accepted Solution

Avatar

Correct answer by
Level 10

Your if statement is incomplete. You need to put the test in again for the other value:

if (form1.Page3.Author.Reviewed.Admin.rawValue == null || form1.Page3.Author.Reviewed.Admin.rawValue == " ")

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Your if statement is incomplete. You need to put the test in again for the other value:

if (form1.Page3.Author.Reviewed.Admin.rawValue == null || form1.Page3.Author.Reviewed.Admin.rawValue == " ")