Print Page | Close Window

Cell Calculation based on 2 check boxes

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 12 Nov 2019 at 1:50am
Software Version: Web Wiz Forums 11.10 -

Topic: Cell Calculation based on 2 check boxes
Posted By: nsmjc1
Subject: Cell Calculation based on 2 check boxes
Date Posted: 04 May 2016 at 1:11pm
I am currently using the following script for calculating a lunch per diem

if (this.getField("CheckBox2MH23").isBoxChecked(0)=="1")
{event.value=this.getField("ofTrainingDays").value*10.00;} else event.value = 0;

if (event.value==0)

What I would like to do is add code to the start of this formula referencing another check box 

Check Box2MH1234a

so if check-box   Box2MH1234a is checked then I want the cell to be blank

Thanks for any help you may provide

Posted By: gkaiseril
Date Posted: 07 May 2016 at 7:44pm
Is there only one field named "CheckBox2MH23"?

If so your method should work. If there is more than one such named field, then you should be using the value of the field. Please read the Adobe JavaScript documentation about "isBoxChcked". The exact field widget used is based on the creation order and not the tab or positional order.

If default the value of the field to "" you can omit the conditional statement.

Have you checked the JavaScript console for errors?

Have you received any pop-ups when creating the form?

You could add some console.print statements to show the value of various fields, variables or branches taken in your script to see what is happening as the script runs.

Posted By: Merlin
Date Posted: 08 May 2016 at 12:34pm

Already answered in the other forum.

ENG : -
FRA : -

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -