< All Topics
  • Main
  • Nintex
  • How can restrict the number of multi choice column?
Print

How can restrict the number of multi choice column?

You have to use Custom Validation for this.

1. Double click on your choice control, and from Advanced section, set Store Client ID in JavaScript variable to Yes, and set the Client ID JavaScript variable name to MemberSelection. Change the Validation -> Use custom validation to Yes, and set Custom validation function to ValidateMemberSelection.

2. From ribbon, go to Settings -> Custom JavaScript section and paste this in:


function ValidateMemberSelection(args, validator) {     var selectedMembers = NWF$('#' + MemberSelection).find(":checked");      validator.IsValid = selectedMembers.length <= 15; }

What this function does is whenever user save the form, it will run this function and check the checked option, you can change the 15 to whatever number you like, this function will invalid if it’s more than 15 option selected.

Previous Expression to restrict the number of digits (numbers) in a text field
Next Issue with Nintex live not getting forms through
Table of Contents