views:

272

answers:

1

I am using ASP.NET checkboxlist control. On the page I have a hyperlink. On its click blockUI plugin displayes a div which contains the checkbox list control.

The state of the checkboxes is always unchecked on calling blockUI again. The checkboxes are always unchecked evenif they were checked before on the page.

$("#multipleIA a:contains('multiple IA')").click(function () { 
        if($("#IACodes select option").size() > 0) 
        { 
            $.blockUI({
                                message: $('#chkgrpIA'),
                                css: { width:'240px', cursor: 'auto', backgroundColor: '#F2F2F2' }    
            });
            $('.blockOverlay').click($.unblockUI);
        }
    });     
    $('#btnDone').click($.unblockUI);
A: 

After some research and trying other juqery plugings I found the problem. To create the modal popup the background content events are disabled. Due to which the checkbox changes are not saved in the dom. Simplemodal, BlockUI and jquery UI Dialog do not persist the checkbox changes between modal window calls.
One solution is to use the jquery cookie plugin to manually save the changes. http://stackoverflow.com/questions/1604114/modal-box-checkbox-cookie

Also opening the dialog in a non modal fashion seems to work pretty well.

Aseem Gautam