These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need to auto-populate text field with value from radio button

407chelsie
Registered: Dec 8 2008
Posts: 68
Answered

I am using Adobe Acrobat 8 Professional. I don't know ANYTHING about Scripting, but need some fancy form functions.

I have 3 radio buttons with different dollar values. When one is selected, I need a text field to contain that dollar value. AND I need to be able to perform a calculation with the dollar value in that text field. EXAMPLE BELOW.

()Membership1 $20
()Membership2 $30
()Membership3 $40

MembershipDues _____
ApplicationFee _____
Total _____

Can anyone walk me through this in elementary steps?

My Product Information:
Acrobat Pro 8.1.3, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
If you set the export value of each radio button equal to the dollar amount of the membership dues, you can set up the "MembershipDues" field to be a calculated field, and simply select the radio button when using the "value is the sum (+) of the following fields" option.

I'm assuming that the ApplicationFee is something the user enters.

For the Total field, set it up as a calculated field and specify the two fields with the "value is the sum..." option.

Be sure to set any calculated field to read-only. This will prevent users from attempting to interact with them.

George
407chelsie
Registered: Dec 8 2008
Posts: 68
That worked PERFECTLY! Thank you!
prander
Registered: Nov 6 2008
Posts: 44
George_Johnson wrote:
If you set the export value of each radio button equal to the dollar amount of the membership dues, you can set up the "MembershipDues" field to be a calculated field, and simply select the radio button when using the "value is the sum (+) of the following fields" option.I'm assuming that the ApplicationFee is something the user enters.

For the Total field, set it up as a calculated field and specify the two fields with the "value is the sum..." option.

Be sure to set any calculated field to read-only. This will prevent users from attempting to interact with them.

George
This actually worked almost perfectly for me as well, but I seem to be having a glitch.

My need was for a radio button-5 choices. Whichever choice would populate the person's score in a text field. That text field becomes part of a calculated total field (also text) which in turn is used for calculation on another text field where calculation is: "TOTAL"/13.
Before my colleague caught the glitch, the radio button's score choice didn't come up in the total (where it was part of the calculation). Then when I tried to fix it, it started doing something even more weird. If I went back and chose another radio button, the score would populate, but on the total score the first radio choice would come up in the total. It's almost as if there's a delayed reaction and the real score will calculate if you hit the button twice.

I'm probably not doing a very good job of explaining the issue. If you'd like to get a copy of the document, please let me know (I don't have an ftp site to post it to, so it will have to be via e-mail).

Thanks in advance
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
It is almost certainly a problem with the field calculation order. Set it so that it makes sense for your form.

George
prander
Registered: Nov 6 2008
Posts: 44
George_Johnson wrote:
It is almost certainly a problem with the field calculation order. Set it so that it makes sense for your form.George
That would make sense. But it's still not completely funtioning correctly. The issue continues to be how the radio buttons behave in the equations if you chose the first one and then decide to pick the second one. The calculations don't change dynamically.

There are 10 "Rate" fields (range limitation of 0-5, 2 dec. number)
There is a text field "ATTEND" whose value is determine by the radio choice of which there are 5: values of 3, 6, 9, 12, 15.

There is a TOTAL text field which was originally a "value sum of" calculation and it's order was alpha-predetermined.

There is a "Overall" text field which should calculate in simple math as TOTAL/13. All of the fields could be an average, however the ATTEND is weighted as 3 so an average would only divide by 11.

I tried to trick it out by creating 2 hidden fields so then I could do a simple 'average' calculation, but the darn radio buttons keep throwing everything off.

Everything is simple. No JavaS'. Any suggestions?
I'm about to start from scratch!!!!
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Feel free to send the form to me by email.