I know how check if the option is selected and the following condition works but I have to refresh the page to applicate the changes.
Here is my code:
$(function (){
var select = $("div.form-group:nth-of-type(2)");
if ($("#id_issue_type option:selected").val() === "other"){
select.show();
}
else {
select.hide();
}
});
The problem is I have to refresh the page and I'd like to applicate the changes directly after I selected the option. My purpose being to hide and show a field depending of the value selected.
Thank you in advance.