ANSWERED
I want to be able to show a calculation from a number of buttons when selected, is this possible? I have say five products with radio buttons underneath them, when the customer selects one of more of these I would like a total price at the side. Hope you can help.


Absolutely [mdash] you can either use radio buttons or check boxes - and I've attached an example that shows both. I've set the output values to equal the $$ amounts and then I used the calculate properties of the SubTotal fields to sum up the numbers. Of course, with radio buttons, you can only select one so you'll not see an addition there.
Next step:
Create a Grand Total that adds from both SubTotal fields.
Good luck!
Offline
I have a similar problem. I would like a user to select various options (radio or check) these options would have cost values assigned to them. If selected, they would calculate a total price. It sounds like this questions is so similar to mine but I did not see and example that I could download and learn from. Can someone send me an example so that I can get a better understanding of how this might work?
Many thanks
PD
Offline

PD,
If you set up your check boxes so that the export values are equal to the price of the corresponding item, you can set up a simple JavaScript routine as the custom calculation script for the total price field. For example, the following is an example that calculates the sum of three check box fields:
// Initialize variables
var sum = 0;
var i, val;
// Loop through the check box fields
for (i = 1; i < 4; i += 1) {
// Get value of the current field
val = getField("checkbox" + i).value;
// If check box is checked, add its value to the sum
if (val !== "Off") {
sum += val;
}
}
// Set this field's value to the sum
event.value = sum;This code assumes the field names are "checkbox1", "checkbox2", and "checkbox3", so you'd have to modify this to suit your form, but you should get the idea.
George
Last edited by George_Johnson (2008-11-13 13:59:38)
Offline
AcrobatUsers.com >> User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in