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

Help with form

ecburris
Registered: Nov 11 2008
Posts: 15
Answered

I am trying to learn how to stop a user from selecting more than one of 3 drop down lists. The form has 3 dropdowns and I have the following in the cell where I want the selection: F.P1.Fee_1[0]+F.P1.Fee_1[1]+F.P1.Fee_1[2] but if the user chooses more that one of them the answer is of course wrong. Can someone help me with a Formcal expression to allow only one of the three.

Thank you
Earl

My Product Information:
Acrobat Pro 7.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So this is a LiveCycle Designer Form??

If you want to make the list fields mutually exclusive then the first thing you need to do is to have some way to distinguish a selected value from a non-selected value. For example each list could have an entry labeled "None" to represnt the "non-selected" state. Next you have to decide how you want the lists to behave. Should a selection in one list block usage of the other lists or should it reset the other lists to the "non-selected" state?

One you have these issues resolved a specific solution will be much easier to come up with.

As for setting a result field. If you want the result to come from a single list then a calculation is probably not the best way to go. Instead, set the field value directly from the selection of the list using the "change" event on each list field.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ecburris
Registered: Nov 11 2008
Posts: 15
Thank you for responding. No this is not a LiveCycle Designer Form it is Adobe 7 Pro. I do want a selection to block usage of the other lists.

Earl
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Well, if it's not a Live Cycle form then the syntax for your calculation in the first post is incorrect. " F.P1.Fee_1[0]" is an XFA (LiveCycle) hierarchy path. Such things don't exist in AcroForms. Also, FormCalc is a LiveCycle only scripting language. AcroForms only use Acrobat JavaScript.

List handling between Acrobat and LiveCycle forms is very different. Have you seen this article? It shows list handling for both forms technologies. Reading it might help you to get a handle on your issue.

http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ecburris
Registered: Nov 11 2008
Posts: 15
Guess I don't know what I have...just checked the help and yes it is as you say. I am terrible sorry for giving you misinformation.

Earl
ecburris
Registered: Nov 11 2008
Posts: 15
I did read the article but I am to much of a beginner to really understand it I am trying to learn how you did it because it looks like it would work for my needs.

How do you block additional entries?

Earl
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok, so you want a set of mutually exclusive drop downs. This requires a solution of some small complexity. JavaScript would work much better for this than FormCalc.

Here's an outline of a solution. All of the drop-down have an initial selection of "None" and all of them are usable. In the "Change" event of each drop-down there is a script that sets the access property of the other two drop-downs based on the selection.

So your code could look something like this:


Change event for DropDown1:
if(xfa.event.change == "None"){// Allow other drop-downs to be selectableDropDown2.access = "open";DropDown3.access = "open";}else{// Block other drop-downs DropDown2.access = "readOnly";DropDown3.access = "readOnly";}

The code for the other dropdowns is the same except for the fields it affects.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ecburris
Registered: Nov 11 2008
Posts: 15
Thanks again...from the parts form I have managed to get my form working like the parts for but have a question about adding some math to the variable see below:

Percent:[ ["-","None"], ["75,000.01 - 100,000.00",.030]]

What I want to do is that the percent .030 times another field I have attempted the following:

Percent:[ ["-","None"], ["75,000.01 - 100,000.00",.030*form1.#subform[0].Gross_GCA]]

but that does not work.

Earl
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This sounds like a new issue. Please create a new forum thread. When you post the question. Please explain more and try to be clear about the context and your goals.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

ecburris
Registered: Nov 11 2008
Posts: 15
I did as you recommended but moved the question over to LiveCycle and no one has responded.

Is it possible for you to check out the question ?

From thomp's parts example http://www.acrobatusers.com/tutorials/2 … livecycle/ I want to add some math to the variable see below:

I want one of the selections from the dropdown to also do math so my question is can that be done for example; can the varialbe multiply to come up with a percentage. If I have a number between 75,000.01 and 100,000.00 (the actual number is in another cell) and want to know what 30% of that number is, can I have the math in the variable.

Percent:[ ["-","None"], ["75,000.01 - 100,000.00",.030*form1.#subform[0].Gross_GCA]]

Of course the way it is now does not work. I am hoping that you can help me with this.

thanks

Earl