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
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;
Thanks for any suggestions.
Well, sometimes I want