Highlighted

Trigger NullTest within Script

Avatar

Avatar

_Eric_Fiori_

Avatar

_Eric_Fiori_

_Eric_Fiori_

17-02-2009

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



Thanks

Replies

Avatar

Avatar

Steve_L_Walker

Total Posts

1.4K

Likes

197

Correct Answer

212

Avatar

Steve_L_Walker

Total Posts

1.4K

Likes

197

Correct Answer

212
Steve_L_Walker

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