Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to add a instruction to a text field

Avatar

Level 2

Dear all,

I am trying different ways to add a guideline to a text field. I tried

1/ To insert a comment, but clearly it is not working with an interactive form in Adobe Acrobat,

2/ To use text field and set the guideline as default value on the object palette but the problem are

- The text field is not expanded horizontally even I chose Expand to fit option

- The guideline does not disappear in case user do not use it

- The box does not shrink also as users do not type enough lines

3/ To use text instead of text field for the guideline, the problem is

- There will be a large space between the two parts since the guideline is not supposed to be printed.

My question is whether there is a smarter way to suggest users typing in the text field by giving the instructions without having it printed out. For instance, is there a way to have a hidden box, you know, it appears as users drag a mouse or click the field?

I know this is might be a naive question, but please help me out. I would really appreciate.

Edigo

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

One solution would be to wrap the four objects in a flowed subform. This will require the file to be saved as a dynamic PDF.

Then set the presence of the texts to "hidden". This excludes them from the layout and allows other objects to take up their space if they are not visible.

Then the mouseEnter and mouseExit events of the textfields set the presence of the guidelines/text. See example.

If you want a textfield to expand, you would also need to save the file as dynamic AND have the objects in a flowed subform.

Good luck,

Niall

View solution in original post

13 Replies

Avatar

Correct answer by
Level 10

Hi,

One solution would be to wrap the four objects in a flowed subform. This will require the file to be saved as a dynamic PDF.

Then set the presence of the texts to "hidden". This excludes them from the layout and allows other objects to take up their space if they are not visible.

Then the mouseEnter and mouseExit events of the textfields set the presence of the guidelines/text. See example.

If you want a textfield to expand, you would also need to save the file as dynamic AND have the objects in a flowed subform.

Good luck,

Niall

Avatar

Former Community Member

You coudl use a tooltip. The text designated in teh tooltip wil appear when the user hovers over the field. You can set the tooltip text on the Accessibility palette. This palette is not vsisible by default.....you can access it under the Window menu.

Paul

Avatar

Level 2

@Niall

It's really impressive. Thanks a million.

@Paul

I don't really understand the Accessibility palette is for. There is not a lot readings about it. And those are not very clear.

Actually there is one more issue. I'm trying to add a table in the form. Export data to MS access via XML. The data from table migrate around instead of being consistent as one table. Is there a solution to the design of the form to avoid the problem? Or a smarter database program might work

Edigo

Avatar

Level 10

Hi Edigo,

One way of showing help text is to use a null picture clause so the help text is displayed within the field but does not appear in the form data.  When the user selects the field the text is cleared automatically so they can enter their response.

I also have some script in the enter and exit events to change the font from italic to normal and from gray to black, so it looks more like help text.

Attached is an example.

Not sure I understand your data export problem, are you saying the rows come out in an inconsistent order?

Bruce

Avatar

Level 2

Hi Bruce,

It sounds good with the script with enter and exit event. But can you please attach the file?

Thanks a ton,

Edigo

Avatar

Level 10

Hi Edigo,

Sorry about that, actually thought it got attached twice.

Hope it gets there this time.

I think it works best when the instruction text is smaller, something like "Dollar amounts only" ... because you can use the same approach on numeric fields ... anyway just another idea.

Bruce

Avatar

Level 2

Hi Bruce,

The scripts are a bit complicated to me. I'm not familiar with the language. Can you have explanation for those?

You and Niall really got the right answers. Great ideas

Edigo

Avatar

Level 10

Hi Edigo,

In the initialize event there is the following statements which just set the initial state of the field;

this.execEvent("exit");

this.format.picture.value = "null{'" + this.assist.toolTip.value + "'}";

The trick to this whole approach is setting the format.picture.value to "null{ some text }" which causes Reader to display the some text whenever the field is null/empty.  In this example I am displaying the text from the toolTip for the field but this could be any text.

In the enter event I change the font to black, normal so it looks like a normal text field once the user starts typing into it.

this.fontColor = "0,0,0";

this.font.posture = "normal";

In the exit event I change font back to grey, italic if the field is null so it looks like help text.  This is also called from the initialize event to set the fields state initially.

if (this.isNull)

{

this.fontColor = "153,153,153";

this.font.posture = "italic";

}

There is some more code in the prePrint and postPrint events so the instruction text doesn't get printed out.

this.format.picture.value = "";

And then after printing setting it back;

this.format.picture.value = "null{'" + this.assist.toolTip.value + "'}";

Hope this helps,

Bruce

Avatar

Level 2

By the way, I made a 3-page PDF file. I tempted to insert all 3 pages into a subform but not successful. Any ideas?

I'd also like to add scripts to the two button add/ remove rows. Can those rows added be name in order, for instance, Week1, Week2, Week3..in the hierarchy tab.

Edigo

Avatar

Former Community Member

The easiest way to wrap things in a subform is to use the hierarchy view on the left. Select the items that you want (in your case Page1, 2 and 3) and right click and choose "wrap in subform".

I have modified your form to allow a dynamic table at the end. I added buttons (with the appropriate scripts). I alos adjusted the table to show the week numbers. The code to populate the week is on the Week subform under the Indexchange event. This code gets fired each time a table row is added or removed.

Hope that helps

Paul

Avatar

Level 2

Hi Paul,

The reason to have the whole flowed form (3 pages) is that most of the textfields can be expanded if needed.

Thus, I did it, but design of the form is changed awfully. The fields that I designed does not stay where I wanted. How do we cope with this difficulty?

You did a wonderful job with the button scripts. Can I somehow get to choose 2 dates in each cell of the date column since most lectures are taught twice a week.

Since I also need to store all the data in MS Access, is there a way to add a Course Code to each page, table in the PDF file without having it printed? In that way I can be able to retrieve data easily.

HOWEVER, the file (or structure) somehow isn't working. I can only export 1 and only 1 data file into MS Access. The second data file requires to import both structure and data instead of data only. It really a mess. Please help!

Edigo

PS: Bruce, I try to read your explanation for the help-text scripts carefully. Then I can make it by my own. Thanks everyone a lot

Avatar

Former Community Member

Wow there is a lot to cover in this thread......

1. A flowed subform means that the content within that form will be placed from left to right top to bottom. In your case where you want to place objects beside each other they need to be within a positioned subform (this means the objects will maintain their position relative to the subform boundaries). So in your case I would break up the form into logical sections and wrap those sections into a flowed subform (make the subform dimensions span the page) then wrap all of the sections in a Page subform that is flowed. Now when it flows everything the positioned subform containers will span the page and will keep theobjects where they are positioned.

2. Each cell can only house 1 object. You could add another column to add the second course date.

3. You can add as many rows and columns as you need....so yes you could add a course code.

4. The form can access a database for filling the form or for writing to the DB, but there are a few things you shoudl know. Reader does not have this capability and it must be enabled using LiveCycle Reader Extensions. This is a server based product so it is priced as such. If you have a small number of users it might be more cost effective to buy Acrobat for each user. Once that is taken care of the connection to the DB is controlled by an ODBC driver in the Windows OS. This means that each machine that loads the form will need to have this driver configured (cannot be automated) as well this solution will only work on a Windows machine. In bigger installations this becomes a maintenance nightmare for most IT shops. Do you still want to proceed down this path?

5. A form can only create a single data file structure ....I do not understand what you mean by the last point....can you elaborate?

Paul