Copy link to clipboard
Copied
if (this.getField("check_co3").value=="yes") event.value=(7000+(this.getField("cop_3").value-50000)*15); else event.value = ""
This has been answered before in a old thread.
Watch how you're spelling "yes" instead of "Yes".
But, in any case try it like this:
//using not equal to "Off" instead of "Yes" because the default state of the chechbox should be unchecked
if (this.getField("check_co3").value !=="Off") {
event.value = (7000+(this.getField("cop_3").value-50000)*15);
}
else event.value = "";
I haven't tested this on my end but give it a try ( I may be wrong).
Copy link to clipboard
Copied
This has been answered before in a old thread.
Watch how you're spelling "yes" instead of "Yes".
But, in any case try it like this:
//using not equal to "Off" instead of "Yes" because the default state of the chechbox should be unchecked
if (this.getField("check_co3").value !=="Off") {
event.value = (7000+(this.getField("cop_3").value-50000)*15);
}
else event.value = "";
I haven't tested this on my end but give it a try ( I may be wrong).
Copy link to clipboard
Copied
Also, where are you trying to run this script from?
Is it a mouse-up javascript action in the checkbox object or are you using this code as a custom calcution script in the text field where you want to display the total ?
Copy link to clipboard
Copied
Its okay the solution came to me as soon as my phone stopped ringing constantly lol you know how it goes... busy work distracts the mind,,, thank you
Copy link to clipboard
Copied
Ok , you're very welcome