conditionize.js icon indicating copy to clipboard operation
conditionize.js copied to clipboard

All child checkboxes in section unchecked on hide

Open esseremmerik opened this issue 7 years ago • 4 comments

Hi there,

This iteration on hide is causing child checkboxes to be unchecked when the section is hidden.

$section.find('select, input').each(function(){ if ( ($(this).attr('type')=='radio') || ($(this).attr('type')=='checkbox') ) { $(this).prop('checked', false).trigger('change'); } else{ $(this).val('').trigger('change'); } });

For my purpose, this is unwanted behaviour as the settings should "stay" intact by their default value state (checked or unchecked). For now I removed this part in my copy of the library, but it would be nice to have more control over what to uncheck in the underlaying section and what not.

esseremmerik avatar Jan 07 '19 13:01 esseremmerik

Hi, I agree. I am going to add it soon in this way.

rguliev avatar Jan 07 '19 20:01 rguliev

I have the same issue with select HTML tag.

BassemN avatar Jan 23 '19 18:01 BassemN

After commenting the following lines, the selected stated is saved and not cleared after change

if ( ($(this).attr('type')=='radio') || ($(this).attr('type')=='checkbox') ) {
   //$(this).prop('checked', false).trigger('change');
}
else{
   //$(this).val('').trigger('change');
}
``

BassemN avatar Jan 23 '19 18:01 BassemN

This issue is fixed in the conditionize2.js Also, take a look at my last comment here

rguliev avatar Apr 15 '19 08:04 rguliev