i have script changes classes on buttons when button clicked. when click type-button selects when click assigned-button refreshes page load form combination selected.
$(document).ready(function () { $(".type-button").click(function () { $(this).toggleclass("btn-thinkware btn-success"); $(".type-button").not(this) .removeclass("btn-success") .addclass("btn-thinkware"); }); $(".assigned-button").click(function () { $(this).toggleclass("btn-thinkware btn-success"); $(".assigned-button").not(this) .removeclass("btn-success") .addclass("btn-thinkware"); }); }); is possible hold selected buttons on refresh? has hold on refresh, doesn't have persist indefinitely, if leave page , come back.
so when new form loads based on combination, can hold selected buttons new classes after page reloads?
is there better way this? or on right track?
since http stateless, need persist state somewhere. use ajax post controller stores button state in session, set cookie value, or set querystring value.
a better solution may refresh part of page needs refreshed , leave buttons.
Comments
Post a Comment