Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

radio button is not checked on page refresh in firefox

<div id="btns">
   <input id="r01" type="radio" name="music" checked>
   <input id="r02" type="radio" name="music">
   <input id="r03" type="radio" name="music">
   <input id="r04" type="radio" name="music">
   <input id="r05" type="radio" name="music">
</div>

Firefox 24 - r1 is not checked on page refresh. On Shift-F5 - works.
Chrome - works.

like image 922
qadenza Avatar asked Oct 11 '13 07:10

qadenza


1 Answers

If it works on shift-F5 it just means, firefox saves the user-input because the form was not sent yet. Firefox keeps form data on reload

Just found a solution!

Just add autocomplete="off" to all you input and you will solve the problem.

jQuery to solve this on all inputs and textareas

$('input,textarea').attr('autocomplete', 'off');
like image 57
Thomas Oster Avatar answered Oct 12 '22 04:10

Thomas Oster