I have a radio button in my html:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input type="radio" name="r"/>
</body>
</html>
If I check it, and reload the page (Firefox 20.0.1) it will stay checked. But if I clear the cache (ctrl+f5) the button gets unchecked again.
Is there any way to make it consistent so that it always unchecks itself when the page is refreshed? Or do I need to involve javascript? I've tried with and without the name
property.
PS. I wasn't able to make a fiddle. Try it on a local file in order to reproduce it.
I have a radio button in my html:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input type="radio" name="r"/>
</body>
</html>
If I check it, and reload the page (Firefox 20.0.1) it will stay checked. But if I clear the cache (ctrl+f5) the button gets unchecked again.
Is there any way to make it consistent so that it always unchecks itself when the page is refreshed? Or do I need to involve javascript? I've tried with and without the name
property.
PS. I wasn't able to make a fiddle. Try it on a local file in order to reproduce it.
Share Improve this question asked May 7, 2013 at 9:09 JohanJohan 35.2k62 gold badges188 silver badges305 bronze badges 4- AFAIK there's no way to do this crossbrowser without JS...I may be wrong tho. – elclanrs Commented May 7, 2013 at 9:11
- @elclanrs I was afraid that this es down to individual browser behaviour... – Johan Commented May 7, 2013 at 9:13
- I think, you have to use javascript for this. clearing cache is a bad practice, as most of the sites depend on it. – dreamweiver Commented May 7, 2013 at 9:14
- 2 Here is a fiddle that reproduced the problem in my Firefox. – ValarDohaeris-fuck-OpenAI Commented May 7, 2013 at 9:17
1 Answer
Reset to default 7You can set autoplete="off"
:
<input type="radio" name="r" autoplete="off" />
Please check this documentations:
Mozilla Dev
W3C
And working example: http://fiddle.jshell/2fAuY/2/show/ (thank you @ValarDohaeris for fiddle)