Once again, I am stumped by seemingly simple things!
I have a drop down box with no default values. I want to display an error message when the user tries to exit without selecting anything. However, my validation script isn't working. Here's what I have set up:
Under the validate event of the Script Editor, I test for blank or null values:
this.rawValue == "" || this.rawValue == null;
Then under the Validation Script message on the Object > Value tab, I have this simple message:
"Please select a type."
Users are able to exit without selecting anything. However, when they actually do select something, then my validation message is shown. What is the correct way of doing this? Thanks for your help.
--Bruce
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
the syntax is similar in JavaScript.
if (this.isNull) {
scriptObject.functionName();
}
Views
Replies
Total Likes
you could put this into the exit event instead (in formcalc):
if ($.isNull) then
xfa.host.messageBox("Please select a type.")
xfa.host.setFocus("$")
endif
Views
Replies
Total Likes
Excellent. Thank you. Worked like a charm.
--Bruce
Views
Replies
Total Likes
Okay, here's the thing. From this field, after checking for a null value, I need to call a Javascript function contained in a Script Object, so I need to find a way to do this null checking in Javascript, not FormCalc. Does anyone have any insight into how to make this work in Javascript? Thanks in advance for your help.
--Bruce
Views
Replies
Total Likes
Hi,
the syntax is similar in JavaScript.
if (this.isNull) {
scriptObject.functionName();
}
Views
Replies
Total Likes
Great. Many thanks. This is working now.
Views
Likes
Replies