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

List Box / Combo

contesa
Registered: Mar 8 2010
Posts: 17
Answered

I know you can have a drop down combo box that allows one selection and data entry.

However, I need to be able to select multiple entries and also allow for user data entry. Can that be achieved with a list box?

Another question I have is regarding date time field.

Is there a way to display both the date and time in the same field (24hour clock) while using the formatting options in order to keep date / time in consistent format when submitting form.

I am new to livecycle forms. Have been reading and learning a lot by reading many forum and viewing tutorials. I can't seem to find the answers to these two questions.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
It can't be done using the standard controls. Combo boxes do not allow multiple selection and list boxes do not allow custom entry. However, its not a problem to create your own control by combining a list box and a text box.

Displaying the date and time shouldn't be an issue, just set the field to be both date and time and set the display option to the format you want. But I'm sure there is more to this than you are saying. What exactly are you trying to do with the date/time 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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

contesa
Registered: Mar 8 2010
Posts: 17
I guess the question is how do I create my own control by combining a list box and a text box? Is there sample code I can review. I'm not a programmer however I have tweaked code before. I am new to livecycle and formcalc and still trying to figure all this out.

I would like users to be able to enter that date and time in this format and upon submission I would like the date and time to be submitted in this format:
dd-mm-yyyy kk:mm (24 hour format)

I tried using kk:mm (got this from reference for livecycle) and it works great as long as the user enters the time in a 24hour format. However, if they enter date incorrectly, the validation error does pop up, but when I click ok, the incorrect data is accepted anyway into the field and focus is no longer on that field but the next. How do I keep focus on that field so user can reenter data correctly?
contesa
Registered: Mar 8 2010
Posts: 17
By the way these are two separate fields I am trying to create. One is a multiple selection with text entry field and one a date/time field.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The actual implementation for building a combined control is not a simple process. It depends a great deal on how you want it to behave. But basically you place both of the controls in a subform so that they are arranged the way you want. Then script them in such a way that they behave appropiatley. Beyond that you'll need to lean about scripting in LiveCycle forms.

As for the date/time field. One thing you can do is to create separate entry fields that are easy to use and force the user to enter data properly. But set the binding on these fields to "None". Then create an invisible field that is the real field that gets submitted. Use scripts to copy data into this field in the correct format.

For example, the date field with the calendar popup is perfect for entering dates. A common way to enter time is with pulldowns for hours and minutes.

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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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