Javascript – Why does a checkbox remain checked in FF3 but not in IE, Chrome or

asp.netcheckboxjavascriptjquery

So – I have a checkbox

<asp:CheckBox ID="chkOrder" runat="server" Visible='<%#IsCheckBoxVisible() %>' 
     Checked="false"
     OnCheckedChanged="chkOrder_CheckedChanged" AutoPostBack="true" 
     EnableViewState="false"></asp:CheckBox>

the one above. Now, the checkbox is in a gridview and on databound – for all the rows in the gridview the checkbox is set to false. The problem is that the first checkbox is still true checked.

In IE the problem doesn't exist, same for Chrome. I'm running out of options.
Also if i use

$("checkboxName").attr("checked"); // verified on jquery ready function.

In FF it is true; IE false; Chrome false.

Any tips?

EDIT

Now get ready for this : in the generated html – there is NO checked attribute.
The diff between FF and IE is exactly the same.

Another thing – the grid that contains the checkboxes has an ajax panel on it and when I page the grid, try to go to page 2 – the checkedChanged in codebehind is triggered.

Best Answer

Firefox remembers the state of form fields by default. Ctrl+F5 will force Firefox to clear this cache.

You can disable this for individual form and input elements:

<form autocomplete="off"> 

<input ... autocomplete="off" />