I have the following form segment:I need a JavaScript that willCode:<table width="90%" border = "0" style="margin-left:40px; font-family: helvetica, ariel, sans-serif; font-size: 0.95em; color: #2D8AB9;"> <tr style="height:3em"> <td width="2em"><input type="checkbox" name="skipperReg" value="<?php echo $skipperFee ?>" /></td> <td width="12em">Registration Fee</td> <td width="4em" style="text-align:right">$<input type="text" name="total" readonly="readonly" size ="2" value="<?php echo $skipperFee ?>" /></td> <td width ="20em"> </td> </tr> <tr> <td ><input type="checkbox" name="guestReg" value="<?php echo $guestFee ?>" /></td> <td>Guest Fee</td><td style="text-align:right">$<input type="text" name="total" readonly="readonly" size ="2" value="<?php echo $guestFee ?>" /></td> <td> # Guests <input type="text" name="GuestQty" size="2" /></td> </tr> <tr> <td ><input type="checkbox" name="miscAmt"/></td> <td>Misc</td><td style="text-align:right">$<input type="text" name="miscTotal" size ="2" /></td> <td> List details <input type="text" name="miscDetails" size="15" /></td> </tr> <tr style="height:2em"><td > </td> <td>Total</td><td style="text-align:right">$<input type="text" name="total" readonly="readonly" size ="2"></td> </tr> </table>
• If skipperReg is checked, add skipperFee value to the total
• If guestReg is checked, add guestFee value times guestQty to the total
• If miscAmt is checked, add miscTotal value to the total
• Display the new total each time the other inputs are changed.
TIA,
--Doug


Reply With Quote




Bookmarks