IE9 change form button change back form back not showing correct state

I have a form with multiple checkboxes. Each time I check / uncheck the box, one form is submitted. Relevant code:

$("input[name='checkboxgroup']").bind("click",function(e) {
     e.preventDefault();
...
...
     form.submit();
});

      

However, when I click the Back button in IE9 all my checkboxes are still checked (Expected: the last checkbox was checked before the Back button was supposed to be checked)

The backend sends data to check / uncheck on every page reload. I have confirmed that the last checkbox clicked before the back button has an unchecked state. However, somehow IE9 sets this checkbox as noted.

Edit

I did some quick checks:

Pre

I have no checkboxes checked

I put a break in the Dev Tools debugger after the instruction e.preventDefault()

... but before submit()

to check the state pushed to the server.

In Dev Tools Console I check $("#checkboxId").attr("checked")

to check the status as I see

What i watched

verify $("#checkboxId1").attr("checked") =  undefined ...(expected as the box is not checked) --> 

check this checkbox ---> hits debugger break point ---> 

verify $("#checkboxId1").attr("checked")  is "checked" (as expected) ...but the browser shows checkbox not checked (also expected..preventDefault effect) --> 

request goes to backend --> reloads page --> 

verify $("#checkboxId1").attr("checked") is checked(as expected) --> 

checkbox is now checked (perfect)

      

... Now the problem:

After doing the above steps ... if I click the button

My expectation: checkbox1 should be checked

Actual Results: It still appears checked.

Other browsers: FF, Chrome, Opera, Safari works on waiting

Any pointers appreciated.

+1


source to share





All Articles