Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: JS that sets a field to zero if ckbox is checked
Conf: (P-PDF) Developers, Msg: 103528
From: kstuck
Date: 1/9/2004 06:40 AM

I have 10 rows. Each row has a column (pre) that you multiply by two other columns (b & c) by. I have a total at the bottom. Simple.

Okay, now there is another column called(post) right after (pre), except this column multiplies (b) & (d). I have a total at the bottom. Simple

The problem is, the user has 10 different employees for each row. Some employees will require the (pre) and some will use the (post).

What I have done so far is put in a radio buttons in (pre) & (post). Each row's radio buttons have the same name but a different export value. This way I can set it up so they can click to use the calculation for either (pre) or (post). If they click (pre) than (post) dissapears, and viceversa. I also tried to write in some script that wouldn't just make it dissapear but make the value zero.

The problem I've been running into is that if it's not clicked on, I can't have the value added up down in the total box.

I'm so close to having this but I keep getting little glitches. This is the script I have so far. Is there either a better way to do this or am I missing something in my JS that needs to be in there to be able to either disable that field or at least have it read $0.00.

var f = this.getField("rate.0");
var g = this.getField("Wage difference.8");
event.value = g.value*f.value;

var myradio=getField("radio.8");
var firmtext=getField("EEcontadjpre.8");
if (myradio.value=="pre8"){

Thanks for any suggestions.


Well, sometimes I want

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.