Thursday, 15 August 2013

Trying to show a if an option is selected

Trying to show a if an option is selected

I've hidden a row in a form but I'd like this row to display when my
select option is set to "Cancelled"
This is how I went about it:
if($("option[value='Cancelled']").attr("selected") == "selected"){
//Remove New option when Cancelled
$("option[value='New']").remove();
$("nobr").filter(function () { return
$.trim(this.childNodes[0].nodeValue) === "Cancel Note";
}).closest("tr").show();
}
In the console, I've noticed that the selected attribute does not
dynamically change when switching between , I assume that's the problem
but I'm not sure how to go about fixing that.

No comments:

Post a Comment