jquery - checkbox buttons hidden status after page refresh -



jquery - checkbox buttons hidden status after page refresh -

i have form checkbox toggle buttons (using twitter bootstrap , rails)

<div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary"> <input type="checkbox"> alternative 1 </label> <label class="btn btn-primary"> <input type="checkbox"> alternative 2 </label> </div>

i click , take option 1. refresh page. when page refreshed buttons reset , option 1 not selected more. if go ahead , submit form, option 1 sent server if selected (checked). bug? because of in cookie. if yes, how can check cookie , find ones should pressed , command alter status pressed.

i have text fields (<input type='text'>) in form well. if write in text fields , refresh page, texts stay. seems somewhere behind scenes state of buttons remain checked, too, on display see them un-checked. hence although checkbox buttons seem un-checked when submit form submitted checked.

thanks lot.

this not best solution it's start: reset buttons after page refresh:

$(document).ready(function() { $('.btn').button('reset'); });

jquery html ruby-on-rails twitter-bootstrap checkbox

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -