I have a script that changes certain classes on buttons when the button is clicked. When you click the type-button it selects it then when you click the assigned-button it refreshes the page to load the form for the combination you 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 it possible to hold the selected buttons on refresh? It only has to hold it on refresh, doesn't have to persist indefinitely, like if they leave the page and come back.
So when the new form loads based on the combination, can I hold the selected buttons new classes after the page reloads?
Is there a better way to do this? or am I on the right track?