Select Checkbox(bool) should automatically select all values in choice(multiple) control. I do not want to specify individual values in choice(Multiple-selection) field control.
Individual values it is working fine. here is my code snippet :
NWF$('#'+Respose).find(':checkbox[value=\'SharePoint\']').attr('checked', true);
Here is my code.
ControlName(Response) is my Multi-selection control ID.
UncheckAll(ControlName){
NWF$('#'+ControlName).prop('checked',false);
}
SelectAll(ControlName){
NWF$('#'+ControlName).prop('checked',true);
}
Does any once know how to clear all and select all items in choice field control.
Solved! Go to Solution.
try following
NWF$('#'+ControlName).find(':checkbox').prop('checked',true)
choice choice control set default value multiselect select all options clear all options sept2017mh
Are you using a choice control with multi-selection option?
Hi Patti Naccarati
were you able to resolve your problem?
if so, could you select an answer that helped you and mark it 'correct answer'?
#BRGreview
Based on initial question, I tried using what was working fine for Gamar G but it is not working for me. I don't know why?
NWF$(document).ready(function () {
NWF$('#'+jsMultiChoiceTest).find(':checkbox[value=\'Test A\']').attr('checked', true);
});
Now I tried solution provided by Marian Hatala, which is also not working, makes me wonder what's wrong with it.
NWF$(document).ready(function () {
NWF$('#'+jsMultiChoiceTest).find(':checkbox').prop('checked', true);
});
here is my control:
Client ID
Which looks like
What I am trying to do is, I want to keep the all the options in one control and then based on lookup field it will select "check"some of the options automatically and "Not Applicable" will go hide.
I don't know how to say check this particular value "Test A".
I have also tried alert which is not working. It shows just blank pop-up with out any value.
NWF$('#' + jsMultiChoiceTest).click(function(){
alert(NWF$('#' + jsMultiChoiceTest).val());
});
If it selects "Not Applicable" all other options should go hide which is something I know how to do.
likely within the ready() event the control is not yet created/populated.
move your code into RegisterAfterReady() event instead.
I figured out that my multi choice option's value was default coded little bit differently than other people. As you can see here with the help of Chad Davis I was able to get the value of a label. but still trying to figure out the way to mark it as Selected.
My default value is just "on" for all the options. i.e. Test A. Test B, Test C and so on.