Hi all,
I'm trying to create a 'Select All' button that automatically checks every option for a specific choice (multiple) control on the form
I've been attempting this for a little while now but can not get this to work. I found a number of posts that appears to have the exact information I needed, but upon implementing the custom JS, the checkbox values never change upon pressing the button.
One (the most recent) suggestion stated I should be using the following syntax: Re: Set value in choice column
NWF$("#"+myChoices).find(":checkboxxvalue='External']").attr("checked","checked");
An older post recommended using either of the following lines of code: Updating a checkbox in a checkbox group on a nintex form using NWF$
NWF$('document').ready(function(){
NWF$('#'+jsvCheckboxField).find(':checkboxcvalue='Checkbox Choice 2']').attr('checked', 'checked');
NWF$('#'+jsvCheckboxField).find('inputnvalue='Checkbox Choice 3']').attr('checked', 'checked');
});
Yet in every case when I try either method, the checkboxes do not update. I placed an alert in the code to test if the function is actually being called (it is). I just can not find how to get the checkboxes to update properly. I have verified the javascript variable name for the choice control matches the custom JS (searchFields), and the function is set to run on client click of the 'Select All' button.
function selectAll() {
NWF$("#" + searchFields).find(":checkbox.value='Subject Line']").attr("checked","checked");
NWF$("#" + searchFields).find(":checkboxlvalue='Message Body']").attr("checked","checked");
NWF$("#" + searchFields).find(":checkboxhvalue='Attachments']").attr("checked","checked");
alert("test");
}
The alert comes up, but the 3 lines before do not appear to have accomplished anything. It should be a very simple function really, so I'm convinced the issue is with the lines of code I'm using to update the checkboxes.
Does anyone have an idea as to what I could be missing here?
I appreciate any assistance with this frustrating issue. Thanks!