- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi Niall,
I've tried to incorporate your example into my form which has a few groups of checkboxes that require at least a single selection. I've got it to work but not without adding in an action for when all is OK.
If there is one selected, I'd like the validation to just move on to the next question.
I had to add a messagebox basically saying validation is OK for the script not to produce an error.
I have the checkboxes wrapped in a subform and all are the same name. Below is the script I currently have in the exit event of the subform. When the line "xfa.host.messageBox("all is ok");" is commented out, I get an error. If it is not commented out, the script works but I would rather not have to have the OK messagebox. I'm not sure how to get it to "do nothing" when at least one item it already checked when the script runs.
if (Sum(SourceOfWealth.SourceWlth[*]) ge 1) then
// all is okay, at least one checkbox is ticked
// xfa.host.messageBox("all is ok");
else
xfa.host.messageBox("Please select at least one Source of Wealth checkbox for Question 12");
xfa.host.setFocus("PersonalEDDQ.PBPernsEDDQ.EDDQSectionI.SourceOfWealth.SourceWlth[0]");
endif
Any additional help will be greatly appreciated! Thanks!
Views
Replies
Total Likes