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
BedrockMission!

Learn More

View all

Sign in to view all badges

Trigger NullTest within Script

Avatar

Avatar
Level 2
_Eric_Fiori_
Level 2

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_Eric_Fiori_
Level 2

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
_Eric_Fiori_
Level 2

17-02-2009

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



Thanks

Replies

Avatar

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

197 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

197 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
Steve_L_Walker
Level 9

20-02-2009

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