Closed ghost closed 10 years ago
Are you using Firefox?
If that is the case, this is documented:
Cross-browser compatibility
Firefox persists the disabled state across page loads. A workaround for this is to use
autocomplete="off"
.
Although that only mentions disabledness, not checkedness.
Yeah, just saw that. Testing out if it is also the case with checkedness.
Yes, that is the case. Maybe we should move that callout and change the copy.
Should also test Chrome just to verify that this is the Firefox-specific problem.
(That is Chrome, FYI)
So we need to update that callout?
Yes, because Firefox persists pretty much any form state across page loads, not only disabledness.
Thank you very much for your responses. Yes, I am using Firefox. Let me read the link you sent and see if it works for me. Really appreciate it.
Following worked for me. It resets the buttons after page refresh:
$(document).ready('bootstrap_buttons', function() {
$('.btn').button('reset');
});
Docs change made, called out all form control states.
@mdo Perhaps we should consider actually using autocomplete="off"
in those examples?
X-Ref: #793
I have a form with checkbox toggle buttons (using twitter bootstrap and Rails)
I click and choose
Option 1
. Then I refresh the page. When the page is refreshed all the buttons are reset andOption 1
is not selected any more. However if I go ahead and submit the form,Option 1
is sent to the server as if it was selected (checked). Is this a bug? Is this because of something in cookie. If yes, how can I check the cookie and find the ones that should be pressed and the command to change their status to pressed.I have text fields (
<input type='text'>
) in the form also. If I write in the text fields and refresh the page, the texts stay. It seems somewhere behind the scenes the state of the buttons stay as checked, too, but on the display I see them as un-checked. Therefore although the checkbox buttons seem to be un-checked when I submit the form they get submitted as checked.Thanks a lot.