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

Radio buttons or checkboxes with value from numeric field

dooda48
Registered: Apr 28 2008
Posts: 15
Answered

Hi guys,
I am a relative newbie with livecycle and have created some forms for a client but am now stuck on something which you guys will probably quickly figure out.

I have trawled through all the relevant posts here and a few other places but i cannot find anything the same as to what i am trying to achieve. I found a couple of posts relating to javascript solutions, but they were not quite what i was after.

What i have is an order form which lists products which have a numeric $ value text box next to the product description, stating the price of the item as well as a checkbox (or radio button, dont know which will work!).

Now, what i want is for users to be able to click/check the button/box and the value of the relevant numeric box summed in a total box (and hence once shoppers have finished checking the boxes the 'total' box will show the total....

It seems quite easy to do if you have a static value of say 1-5 etc (or any other value you set in the binding 'on' value), but i need the value to change according to what is in the numeric field box.

I have done some very basic things with formcalc, but not with javascript. if i could stick to formcalc for now that would be great (if not, will just have to learn asap!).

I can upload a copy if that helps, but not sure where to as i have only just joined up.

Any help would be greatly appreciated.

thanks in advance,

Dooda

My Product Information:
LiveCycle Designer, Windows
KathrynGZ
Registered: Apr 15 2008
Posts: 35
Dooda,

Is there a reason you wouldn't want the total to display automatically, without user intervention? If you sum all the fields in the calculate event of the total box, it should do what you're looking for, and the total will update whenever there's a change. (If this makes no sense, let me know and I can provide an example :) )

If I'm not understanding what you want to do, please elaborate :)

Kathryn
dooda48
Registered: Apr 28 2008
Posts: 15
Hi Kathryn (and everyone else),
Unfortunately my post didn’t explain what I was after very well, and without seeing my form I can imagine its impossible to know what I am talking about eh.

So, I have uploaded 2 forms here http://groups.google.com/group/livecycle/files (because I actually have two calculation problems now).

I have searched for solutions for these for the last 4 days, and just cannot seem to find exactly what I need. Some solutions seem so close, but they don’t quite do what I need.

The first, OrderForm_1.pdf is my original problem.
What I want is for the check boxes on the left of the 4 ‘products’ (Energy pack, Heathpointe program, Coaching, Extras) to have the value of whatever has been inputed in the right hand numeric field on the same line, which would then sum in the ‘Total Investment’ field (but only if the relevant check boxes have been ticked)

Along the same lines, I need the products listed under ‘Extras’ to have the same functionality (ie if the check box next to ‘Fruit veg’ is ticked the value of ‘Extras[0] is added to the ‘Extras’ total) This checkbox would probably be better if it was a numeric dropdown as the tickbox limits customers to only one of each of the products (when they may actually want more than one).

Setting the calculation of total boxes seems easy compared to this! (the Total Investment would just be the 4 total boxes added, plus the p&p).The second one is OrderForm_2.pdf.
Now, this one SHOULD be easy………..I have found about 4 different ‘solutions’ none of which seemed to work for me (‘user error’ comes to mind!).
All I want is for the ‘Amount’ fields to be empty, unless a quantity is added to the quantity field. It currently says $0.00. This field obviously sums the retail x quantity, which I still need in there. Seems like loads of people have the same issue, and some fix it (and some like me don’t).

I would really appreciate any help with these two problems, but something I have seen on here is the experts posting the scripts which will solve peoples problems, but not really saying ‘exactly’ where to put it. Ie whether it needs to go in the calculation or validate etc sections of the script editor.

Thank you so much in advance for your wisdom and skill (and knowledge obviously)

Dooda
KathrynGZ
Registered: Apr 15 2008
Posts: 35
Dooda,

I think my answer (second to last posting) on this page will help with the second problem:
http://www.adobeforums.com/webx/.3bb8833a

If this doesn't work for you, let us know the code you used that didn't work.

I haven't had a chance to look at your form yet, but will post any ideas I have when I can.

Have a good one!

Kathryn
dooda48
Registered: Apr 28 2008
Posts: 15
Hi Kathryn, thanks for the reply,
That was one of the solutions i had tried. I couldnt seem to get it to work for me (if memory serves me right, it hid the $0.00, but the calculation didnt work).

I will give it another go this evening and let you know what code i used.

Ta,

Dooda
dooda48
Registered: Apr 28 2008
Posts: 15
UPDATE:

Well, amazingly i have been able to figure out the difficult bit (first problem). I will upload that file once I'm done.

But still cant get the pesky 0's to not appear!

If someone could take a look at 'OrderForm_2.pdf' for me and tell me how to get those 0's to not appear that would be fab.

Kathryn, I tried your method again and just couldnt get it to work unfortunately.

I spend a few hours downloading about 50 fillable forms from all over the net trying to find one that had what i was looking for, but they all seem to have gone down the route of leaving the 0's in.

It must be EASY! I'm just being dumb i think.

Cheers guys.

Dooda
KathrynGZ
Registered: Apr 15 2008
Posts: 35
Hey Dooda,

Thanks for uploading the file. I was able to get the script to work for issue #2. I put the following formcalc on the calculate event of topmostSubform.Page1.Amount[0]:

if (hasValue(Quantity[0])) then
$.rawValue = Quantity[0] * Retail[0]
else
$.rawValue = ""
endif

Let me know if that works for you--

Kathryn
dooda48
Registered: Apr 28 2008
Posts: 15
Kathryn you are a STAR!!!!

Works perfectly, thank you so much.

I will upload the two forms to the other forum once i have completed the calcs for others to reference

Thanks again, you've saved my life (i might get some sleep now!)

Regards,
Dooda
KathrynGZ
Registered: Apr 15 2008
Posts: 35
Dooda,

Glad to help & good luck catching up on sleep :)Kathryn
dooda48
Registered: Apr 28 2008
Posts: 15
hi hohumding, will try and upload the final form tonight, or tomorrow, having issues with my connection at the mo!
you will be able to work out (or copy the scripts) from the final form.
Cheers,
Dooda
hughesr
Registered: Dec 18 2008
Posts: 7
dooda48 wrote:
hi hohumding, will try and upload the final form tonight, or tomorrow, having issues with my connection at the mo!
you will be able to work out (or copy the scripts) from the final form.
Cheers,
Dooda
I am new to this forum as I just got Adobe 9 Pro. I am trying to accomplish the same thing you did in your forms. Where do I find your examples in the forum?

Thank you

Rick