I have posted [url=http://idisk.mac.com:80//chelsie.hall/Public/App-RM-09117-2.pdf]the example here[/url].
I received help from gkaiseril on this topic but now the client has changed it again and despite my best efforts, I'm unable to get the code edited properly. The existing code is:
// total membership dues custom calculation // Compute Total Membership Dues // Get number of membership dues, as a number var mem_dues = this.getField("Membership Classification").value; // if not a number set to zero if (isNaN(mem_dues) == true ) mem_dues = 0; this.getField('Membership Dues').value = mem_dues; // assume field is hidden, display if none zero // get Membership dues object var oMem_Dues = this.getField('Membership Dues'); oMem_Dues.display = display.hidden; if (mem_dues > 0) oMem_Dues.display = display.visible // compute specialty membership total // get field values var ceesp = this.getField("Chief Audit Executive Services Program").value; var fsag = this.getField("Financial Services Auditor Group").value; var gag = this.getField("Gaming Audit Group").value; var spec_sum = 0; // set any non-numberic values to zero if(isNaN(ceesp) == true) ceesp = 0; if(isNaN(fsag) == true) fsag = 0; if(isNaN(gag) == true) gag = 0; // compute value spec_mem = Number(ceesp) + fsag + gag; this.getField('Specialty Membership Total').value = spec_mem // assume field is hidden, display if none zero // get Membership dues object var oSpec_Mem = this.getField('Specialty Membership Total'); oSpec_Mem.display = display.hidden; if (spec_mem > 0) oSpec_Mem.display = display.visible // compute total dues event.value = mem_dues + spec_mem; // assume field is hidden, display if none zero this.getField(event.target.name).display = display.hidden; if (event.value > 0) this.getField(event.target.name).display = display.visible
I need to change this so that the "Application Fee" changes dependent on the "Membership Classification" selected. It needs to be $25 if the first radio button is selected and $0 if another button is selected AND hidden if no selection has been made.
PLEASE HELP. I'm in WAY over my head!
Then all this calculation needs to do is acquire that value.
You also don't need this code, it's redundant.
this.getField(event.target.name).display
instead, use this:
event.target.display
Now, the way the Membership dues calculation is setup, you don't need to do anything to the code to change the value of the membership due. All you have to do is change the export value of the Radio Buttons.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script