cancel
Showing results for 
Search instead for 
Did you mean: 

unchecking the checkbox on click of cancel button

former_member200679
Participant
0 Kudos

Hi everyone,

I want to uncheck a checkbox which i selected in edit mode.

checkbox values :1 to 4 are coming from the odata and in edit mode i selected checkbox 8.

On clicking cancel button, checkbox 8 should be unchecked and the view get restored to 4 checked boxes.

How do i achieve it?

Please share your ideas.

Thanks,

Saurabh Singh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you're going with jQuery, then apply this code on press cancel


$('#id of CheckBox').prop('checked', true);
$
('#id of CheckBox').prop('checked', false);

former_member200679
Participant
0 Kudos

This will remove al the checked boxes, i want to remove the new checked box whose value is not coming from odata.

Former Member
0 Kudos

Hi,

Just a try. On edit mode you just get all selected items, (before) user starts editing and store in variable. On press cancel button, u can use previous code to remove all selected item and run a loop to check to withstand previous state.

Former Member
0 Kudos

Is this what you are trying?

JS Bin - Collaborative JavaScript Debugging

If not please let us know

Answers (1)

Answers (1)

former_member200679
Participant
0 Kudos

Storing each checkboxes value in a variable is a tiring process and is not feasible for large number of checkboxes. So all i had to do was call the url (odata) to display detail page on cancel button click and it worked. This way its efficient, not much of coding is required , just re-using the existing function.

Thanks Pradeep and Indrajith for your efforts.