I’m trying to execute this function when a select list’s (LevelId0) value change but its not being executed. Tried this inside $(document).ready() and outside of it. hasFullAccess is a local boolean variable in the window.
$("#LevelId0").change(function() {
if (hasFullAccess) {
alert("oy");
}
else {
alert("oi");
// var currentYear = (new Date).getFullYear();
// $(".bound").val("01/01/" + (currentYear + 1));
//$(".EffectiveDateClass").val("01/01/"+(currentYear +1));
}
});
SOLUTION
@if (!hasFullAccess)
{
<text>$(document).on('change', "#LevelId0, #CLevelId1", function() {
var currentYear = (new Date).getFullYear();
$("#LevelId1, #LevelId0").val($(this).val());
$("#EffectiveDate0, #EffectiveDate1,.EffectiveDateClass").val("01/01/" + (currentYear + 1));
});
</text>
}
what you really want perhaps:
What does this alert in the
$(document).ready(:EDIT: ALTERED FUNCTION: