<p><ahref="https://github.com/fezvrasta/bootstrap-material-design/issues/793">Firefox persists form control states (disabledness and checkedness) across page loads</a>. A workaround for this is to use <code>autocomplete="off"</code>. See <ahref="https://bugzilla.mozilla.org/show_bug.cgi?id=654072">Mozilla bug #654072</a>.</p>
<p>For the sake of this demonstration, we are using <code>data-loading-text</code> and <code>$().button('loading')</code>, but that's not the only state you can use. <ahref="#buttons-methods">See more on this below in the <code>$().button(string)</code> documentation</a>.</p>
<h4>Pre-toggled buttons need <code>.active</code> and <code>aria-pressed="true"</code></h4>
<p>For pre-toggled buttons, you must add the <code>.active</code> class and the <code>aria-pressed="true"</code> attribute to the <code>button</code> yourself.</p>
<p>Add <code>data-toggle="buttons"</code> to a <code>.btn-group</code> containing checkbox or radio inputs to enable toggling in their respective styles.</p>
<h4>Visual checked state only updated on click</h4>
<p>If the checked state of a checkbox button is updated without firing a <code>click</code> event on the button (e.g. via <code><input type="reset"></code> or via setting the <code>checked</code> property of the input), you will need to toggle the <code>.active</code> class on the input's <code>label</code> yourself.</p>
<inputtype="radio"name="options"id="option1"autocomplete="off"checked> Radio 1 (preselected)
</label>
<labelclass="btn btn-primary">
<inputtype="radio"name="options"id="option2"autocomplete="off"> Radio 2
</label>
<labelclass="btn btn-primary">
<inputtype="radio"name="options"id="option3"autocomplete="off"> Radio 3
</label>
</div>
</div><!-- /example -->
{% highlight html %}
<divclass="btn-group"data-toggle="buttons">
<labelclass="btn btn-primary active">
<inputtype="radio"name="options"id="option1"autocomplete="off"checked> Radio 1 (preselected)
</label>
<labelclass="btn btn-primary">
<inputtype="radio"name="options"id="option2"autocomplete="off"> Radio 2
</label>
<labelclass="btn btn-primary">
<inputtype="radio"name="options"id="option3"autocomplete="off"> Radio 3
</label>
</div>
{% endhighlight %}
<h2id="buttons-methods">Methods</h2>
<h4><code>$().button('toggle')</code></h4>
<p>Toggles push state. Gives the button the appearance that it has been activated.</p>
<h4><code>$().button('reset')</code></h4>
<p>Resets button state - swaps text to original text. <strong>This method is asynchronous and returns before the resetting has actually completed.</strong></p>