You don't need hidden text fields.
This code should do the trick. Use it as the custom calculation script of "TotalFee":
var totalFee = 0; if (this.getField("Exam1").value!="Off") totalFee+=90; if (this.getField("Exam2").value!="Off") totalFee+=90; totalFee+=Number(this.getField("TutorialFee").value)*90; event.value = totalFee;
Wow! That's pretty simple. Not sure where I was going with the hidden textboxes. :-)
Just a minor glitch in that the "TotalFee" produces an incorrect value, but if I change "TutorialFee" to "TutorialSessions" it works perfect.
TutorialFee is a separate custom calculation that I managed to work out myself.
Thanks for your help.
That is not a minor thing. It usually means that the field calculation order is incorrect. You need to fix it if you want it to work correctly.
This is a pretty good general JS tutorial:
For PDF-specific JS check out:
Fixed as follows, which seems to work perfect...
// Code for "TutorialFee" field
event.value = (this.getField("TutorialSessions").value * 90);
/// Code for "TotalFee" field
var totalFee = 0;
if (this.getField("KnowledgeTest").value!="Off") totalFee+=90;
if (this.getField("SkillsAssessment").value!="Off") totalFee+=90;
event.value = totalFee;
Maybe I misunderstood the issue... If it works, great!
Thanks for you help yet again, as this isn't the first time you've pointed me in the right direction.
Hopefully I can start to work some of this stuff out myself with the links you've provided.