cancel
Showing results for 
Search instead for 
Did you mean: 
jvolk85
Nintex Newbie

Automating the selection of an item in a choice field

Jump to solution

I have a choice field where multiple items can be selected. There is one instance where if a users selects a Virtual Desktop, they also need to have Remote Access. Is it possible to automatically check Remote Access so the user does not forget that part? Here is the field:

Labels: (1)
0 Kudos
Reply
2 Replies
pwarrak
Nintex Newbie

Re: Automating the selection of an item in a choice field

Jump to solution

Hi,

Add a CSS class to the choice control as per the below:

\

Then add the below JavaScript to the form:

NWF$(document).ready(function () {
            NWF$('.ChoiceClass input[type="checkbox"]').change(function () {
                var VirtualDesktop = false;
                var RemoteAccess = false;
                NWF$('.ChoiceClass input[type="checkbox"]:checked').each(function (index, elem) {
                    if (NWF$(elem).val() == 'Virtual Desktop') {
                        VirtualDesktop = true;
                    }
                    if (NWF$(elem).val() == 'Remote Access') {
                        RemoteAccess = true;
                    }
                });
                if (VirtualDesktop && !RemoteAccess) {
                    NWF$('.ChoiceClass input[type="checkbox"][value="Remote Access"]').prop('checked', 'checked');
                }
            });
});‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Be aware of the hard coded 'Virtual Desktop' and 'Remote Access' (Double check the values please).

Enjoy and keep running on pure Nintex Adrenaline !!!

0 Kudos
Reply
Automation Master
Automation Master

Re: Automating the selection of an item in a choice field

Jump to solution

if you want to avoid javascript, you could just setup a validation rule.

it will not preset choice options, but will not allow a user to submit form if the two required option are both not selected.

validation rule formula might look like

inArray(DeviceChoice,'Virtual Desktop') && not(inArray(DeviceChoice,'Remote Access'))

‌ select two options‌

Reply