I'm just starting out with JavaScript and feeling a bit lost. I came across some code that adjusts the attributes of a Div based on a selection from a dropdown list. Now, I want to tweak it so that it works when a radio button is selected instead.
Below is the current code snippet:
function pageLoad(sender, args) {
if (args.get_isPartialLoad()) {
var rangeType = $('#<%= DateRangeList.ClientID%>').val();
if (rangeType == 6) {
$('#DatePeriodRow').removeAttr("style");
}
else {
$('#DatePeriodRow').attr("style", "display: none;");
}
}
}
$(document).ready(function () {
$('#<%= DateRangeList.ClientID %>').live("change", function() {
var rangeType = $('#<%= DateRangeList.ClientID %>').val();
if (rangeType == 6) {
$('#DatePeriodRow').removeAttr("style");
}
else {
$('#DatePeriodRow').attr("style", "display: none;");
}
});
})
I've been attempting different ways to adjust this code for my requirements, but haven't had any success yet. Despite searching online extensively, I keep encountering the "Property/Value is null or undefined" error message, which leaves me stumped in terms of debugging on the Java end.
Your assistance would be immensely valued!