As in the title, I'm struggling with what I thought being a trivial issue: disabling an option from an HTML Select tag list when I click on an aforethought radio button.
My code does work, but when a user hits the browser back-button, my function doesn't get called anymore, so the previously disabled selector can now be chosen from the list. I'd prefer to avoid reloading the HTML page when I press the back-button using PHP, as advised in this topic.
This is my Javascript code:
$(function () {
$("#radioButton1").on("click", function () {
$("#selector3").prop("disabled", false);
});
$("#radioButton2").on("click", function () {
var selector = $("#selector3");
selector.prop("disabled", true);
selector.css("background", "#dddddd");
$("#orderByList").val("1");
});
});