Force value using checkbox
Hoping someone can help with this.
I have a form with several rows of fields as follows (only showing row 1 below)...
"Unit_1" (dropdown), "Unit_1_Fee" (textbox, currency), "Unit_1_Var" (textbox, numeric), "Unit_1_Actual_Fee" (textbox, currency).
When a unit is selected in "Unit_1", the associated fee is shown in "Unit_1_Fee" which is a value retrieved from a Document JavaScript.
If "Unit_1_Var" is empty, the value in "Unit_1_Fee" is also displayed in "Unit_1_Actual_Fee".
If a "1" is entered into "Unit_1_Var", the value in "Unit_1_Actual_Fee" is "120" (an override value).
The following script is attached to the "Unit_1_Actual_Fee" field to achieve this...
if (this.getField("Unit_1").valueAsString!=this.getField("Unit_1").defaultValue) {
var altValue = Number(this.getField("Unit_1_Var").value) * 120;
event.value = altValue>0 ? altValue : (Number(this.getField("Unit_1_Fee").value);
} else event.value = "";
What I'm hoping to do is to modify this to use a checkbox instead of the numeric field "Unit_1_Var".
Ideally, I would like to be able to get rid of the "Unit_1_Actual_Fee" field and just have the "Unit_1_Fee" value change from the lookup value to "120" if the checkbox is selected.
Hopefully this makes sense. Any help would be appreciated.
