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

Javascript for Selectall and Clearall on Choice control

Jump to solution

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.

0 Kudos
Reply
7 Replies
emha
Nintex Newbie

Re: Javascript for Selectall and Clearall on Choice control

Jump 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

Reply
burkslm
Nintex Newbie

Re: Javascript for Selectall and Clearall on Choice control

Jump to solution

‌, you created this as a discussion instead of a question. I converted it to a question so users in the community would know you are looking for help.

Reply
pwarrak
Nintex Newbie

Re: Javascript for Selectall and Clearall on Choice control

Jump to solution

Are you using a choice control with multi-selection option?

0 Kudos
Reply
emha
Nintex Newbie

Re: Javascript for Selectall and Clearall on Choice control

Jump to solution

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

0 Kudos
Reply
ahmad84
Nintex Newbie

Re: Javascript for Selectall and Clearall on Choice control

Jump to solution

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:

MultiChoiceControl

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.

0 Kudos
Reply
emha
Nintex Newbie

Re: Javascript for Selectall and Clearall on Choice control

Jump to solution

likely within the ready() event the control is not yet created/populated.

move your code into RegisterAfterReady() event instead.

    

The Big Event: A Closer Look At Nintex Form Events 

0 Kudos
Reply
ahmad84
Nintex Newbie

Re: Javascript for Selectall and Clearall on Choice control

Jump to solution

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.

0 Kudos
Reply