I have 2 checkboxes inside a form and both those checkboxes were wrapped inside a form
.
For one of form
I have added the attribute autocomplete="off"
.
Below is the code snippet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
<form name="chkBoxForm" >
<div>
<input type="checkbox" value="100" name="product"/>My Checkbox1
</div>
</form>
<form name="chkBoxForm" autocomplete="off">
<div>
<input type="checkbox" value="200" name="product"/>My Checkbox2
</div>
</form>
</body>
</html>
Now my problem here if we check those checkboxes manually and if we press F5, then the checkbox with attribute autocomplete="off"
got unchecked. But the checkbox which doesn't have that attribute remains checked. This happens in FireFox 22.
This behavior varies from Browser to Browser.
In IE, both the checkboxes remains checked and in Chrome both the checkboxes were unchecked.
But when I press enter in the address bar, it gets unchecked in all the browsers.
Can someone tell me how to have those checkboxes unchecked always when we press F5?
I am aware that this can be handled through Javascript.
Is there any other html way of handling this?