Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Using Radio Button to Calculate
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Using Radio Button to Calculate

 Post Reply Post Reply
Author
gq1969 View Drop Down
New Member
New Member
Avatar

Joined: 13 Jun 2012
Location: louisiana
Points: 7
Post Options Post Options   Quote gq1969 Quote  Post ReplyReply Direct Link To This Post Topic: Using Radio Button to Calculate
    Posted: 03 Aug 2012 at 5:43pm
I am making a pdf contract and I need to use check boxes/ radio buttons for customer to choose product and pricing will automatically show up in total box.

Example
Button 1 checked  total box shows 200.00
if button 2 checked total box shows 300.00
else total shows 500.00

can anyone help with scripts and placement of scripts

Under total box

if (this.get Field("total").value == "button1") {
event.value = 200.00
}
else if (this.getField("total").value == "button1") {
event.value = 300.00
}
else {
event.value = 500.00
}
Pedro
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4111
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 03 Aug 2012 at 6:12pm
First, radio buttons work like the old mechnaical buttons on a car radio, you can only select one and you can not unselect unless one selects a different button. So I suggest you use check boxes.
 
Now you have the following possabilites:
 
None checked
Button 1 only checked
Button 2 only checked
Buttons 1 & 2 checked
 
You have explained all but the "none checked" actions.
 
I would assign an "Export" value to each check box. Check box 1 woudl have a value of 200 and check box 2 a value of 300.
 
For your total field you can use the calculation option "Field is the sum of the following fields:" and select check box 1 and check box 2. The calculation will automatically only sum numeric values, in this case the export value of the selected check boxes.
 
Back to Top
gq1969 View Drop Down
New Member
New Member
Avatar

Joined: 13 Jun 2012
Location: louisiana
Points: 7
Post Options Post Options   Quote gq1969 Quote  Post ReplyReply Direct Link To This Post Posted: 03 Aug 2012 at 11:14pm
could you please lay out scripts for me to paste in boxes

have button 2 checked as default




Edited by gq1969 - 03 Aug 2012 at 11:16pm
Pedro
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4111
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 04 Aug 2012 at 5:36pm
'There is no user script since one is using the calculate option for selecting only the operation and fields to process on Acrobat's Field Properties Calculation tab.
 
Are you using LiveCycle Designer?
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

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

This page was generated in 0.047 seconds.