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

Updating a checkbox in a checkbox group on a nintex form using NWF$

I currently successfully use the following statement in JavaScript to update a radio button on a Nintex form:

NWF$('#'+jsvRadioButtonField).find('input[value=\'Radio Choice 2\']').attr('checked', 'checked');

What is the equivalent for updating a checkbox in a checkbox group on a Nintex form?

Labels: (3)
Tags (1)
Reply
4 Replies
amcmahon
Nintex Newbie

Re: Updating a checkbox in a checkbox group on a nintex form using NWF$

I haven't delved into this, but on a quick glance, have you tried using true or false, instead of checked?

For instance:

NWF$('#'+jsvRadioButtonField).find('input[value=\'Radio Choice 2\']').attr('checked', 'true');

or

NWF$('#'+jsvRadioButtonField).find('input[value=\'Radio Choice 2\']').attr('checked', 'false');

0 Kudos
Reply
seyeraj
Nintex Newbie

Re: Updating a checkbox in a checkbox group on a nintex form using NWF$

Radio buttons work fine. The following all work with radio buttons.

NWF$('#'+jsvRadioButtonField).find('input[value=\'Radio Choice 2\']').attr('checked', ‘true’);

NWF$('#'+jsvRadioButtonField).find('input[value=\'Radio Choice 2\']').attr('checked', true);

NWF$('#'+jsvRadioButtonField).find('input[value=\'Radio Choice 2\']').attr('checked', ‘checked’);

The issue is with checkboxes. I have tried the following on a checkbox group and none of them work.

NWF$('#'+jsvCheckboxField).find('input[value=\'Checkbox Choice 2\']').attr('checked', 'true');

NWF$('#'+jsvCheckboxField).find('input[value=\'Checkbox Choice 2\']').attr('checked', true);

NWF$('#'+jsvCheckboxField).find('input[value=\'Checkbox Choice 2\']').attr('checked', 'checked');

Reply
Not applicable

Re: Updating a checkbox in a checkbox group on a nintex form using NWF$

Hi,

Actually, I was little surprise that those snippets at bottom not working.

I just tested. This worked for me:

NWF$('document').ready(function(){

   NWF$('#'+jsvCheckboxField).find(':checkbox[value=\'Checkbox Choice 2\']').attr('checked', 'checked');

   NWF$('#'+jsvCheckboxField).find('input[value=\'Checkbox Choice 3\']').attr('checked', 'checked');

});

Maybe you didn't put inside NWF$('document').ready ? Because those basically are jquery function, need wait jQuery finished load first, only can execute the script.

Reply
jun
Nintex Newbie

Re: Updating a checkbox in a checkbox group on a nintex form using NWF$

Hi there,

Do you know how to get the value from a radio button group using JavaScript on Nintex form?

Thanks

0 Kudos
Reply