Good Evening,
How can I display the description and interpretation depends on the scale range. Sample display below
Hi @Roie,
Try adding this code to the custom JavaScript of your form:
fd.rendered(function() {
fd.field('ScaleRange').$on('change', function(value) {
if (value > 1.00 && value < 1.49) {
fd.field('Description').value = "Very Poor";
fd.field('Interpretation').value = "Fail";
return;
}
if (value > 1.50 && value < 2.49) {
fd.field('Description').value = "Poor";
fd.field('Interpretation').value = "Fail";
return;
}
if (value > 2.50 && value < 3.49) {
fd.field('Description').value = "Average";
fd.field('Interpretation').value = "Pass";
return;
}
if (value > 3.50 && value < 4.49) {
fd.field('Description').value = "Good";
fd.field('Interpretation').value = "Pass";
return;
}
if (value > 4.50 && value <= 5.00) {
fd.field('Description').value = "Excellent";
fd.field('Interpretation').value = "Pass";
return;
}
fd.field('Description').value = "";
fd.field('Interpretation').value = "";
});
});
Make sure the field names in the code match the field names on your form.
If you're using SharePoint Forms and not Web Forms, replace fd.rendered
with fd.spRendered
.