Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Trigger NullTest within Script

_Eric_Fiori_
Level 2
Level 2
is there a way to trigger a nullTest validation within a script without having to click submit?



Thanks
1 Reply
Steve_L_Walker
Level 10
Level 10
Eric,



There is. The simplest and perhaps most common example would be a text field. You could add the following script on the exit event to test for null.



if (this.formattedValue.length == 0 && this.editValue.length == 0) {

xfa.host.messageBox("This field is null.")

}



Note that I am not testing for (this.rawValue == ""). For empty fields, rawValue is represented as a null object. A test for "" will not successfully detect an empty field since null != "".



Steve