I'm building a form which brings back a database column which is boolean and whihc is
to be exhibited in a check box field.
Here's the code:
function getMetricDetailList() {
debugger;
var MetricID = $("#metricDropDown").val();
$.ajax
({
url: '/Forms/GetMetricDetailList',
type: 'POST',
datatype: 'application/json',
contentType: 'application/json',
data: JSON.stringify({
MetricID: +MetricID
}),
success: function (result) {
$.each($.parseJSON(result), function (i, metric) {
$("#firstbox").val(metric.MetricID);
$("#secondbox").val(metric.MetricDesc);
$("#thirdbox").val(metric.Description);
$("#unitDropDown").val(metric.MetricUnitID);
$("#calctypeDropDown").val(metric.CalculationTypeID)
$("#orgDropDown").val(metric.OrganisationLevelID)
alert("We are here.. " + metric.YearToDateAppropriateFlag)
if (metric.YearToDateAppropriateFlag == true) {
alert("Truism");
$("#ytdappbox").iCheck('check');
} else {
alert("Falsehood");
$("#ytdappbox").iCheck('uncheck');
};
})
},
error: function () {
alert("Whooaaa! Something went wrong..")
},
});
}
when the form loads, the function works when YearToDateAppropriateFlag is TRUE and then
when YearToDateAppropriateFlag becomes FALSE the box is checked then unchecked - but it
is never checked again even when YearToDateAppropriateFlag bceomes TRUE again; the alert("Truism");
alert does fire but not the check statement beneath it.
Is there something that needs reseting there?
I'm using the wrapbootstrap INSPINIA template by the way, is that affecting this?
Hi there,
I'm building a form which brings back a database column which is boolean and whihc is to be exhibited in a check box field. Here's the code:
when the form loads, the function works when YearToDateAppropriateFlag is TRUE and then when YearToDateAppropriateFlag becomes FALSE the box is checked then unchecked - but it is never checked again even when YearToDateAppropriateFlag bceomes TRUE again; the alert("Truism"); alert does fire but not the check statement beneath it.
Is there something that needs reseting there? I'm using the wrapbootstrap INSPINIA template by the way, is that affecting this?