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

Need Tool Tip

deepusrp
Registered: Jan 12 2009
Posts: 51

Hello,

I have a data field on my form, i want to display a tool tip stating the format in which user has to enter data.

The problem is if u give ur message on the tool tip, it'll show only on mouse over and not when using keyboard (tab from previous page). Moreover, it'll dissapear soon.

I want something like a tip that will stay untill the user goes out of the field on both cases (keyboard and mouse). Can i do that? The tip has to be displayed when user enters the field and stays below till he goes out of that field.

Thanks in advance
Deepak

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can use JS in the enter event of the field to prompt a message box.

xfa.host.messageBox("Message for the users.", "Attention",0,0);

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

deepusrp
Registered: Jan 12 2009
Posts: 51
Actually i dont need a big messagebox popping up. I need a small tool tip just below the field. (not popping up)
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
In AcroJS you can use...

var f = this.getField("data field");
f.userName = "This is a tooltip for you.";...but within DesignerJS there is no alternative for this!
I've tried this, but it doesn't work.

var f = xfa.resolveNode("Form1.Page1.Data field").rawValue;
f.userName = "This is a tooltip for you.";

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

deepusrp
Registered: Jan 12 2009
Posts: 51
Is there any round about...?

My problem is, as we cant restrict keyboard input on Date/Time field, user can enter it in numerous ways. If it is not according to standard format then script fails. In order to avoid this, i have to instruct the user to enter date in a particular format.

I have few questions:

-> Can we restrict user input on Date/Time field so that they are forced to select only from the dropdown calendar?-> Is there any method by which i can convert date entered in any format into a standard format. Lets say YYYY/MM/DD
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can use the Format function to convert the users input automatically to the prefferd date format.
Put this into the layout:ready event of the date field.

$.rawValue = Format("YYYY.MM.DD", $.rawValue)

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

djinges
Registered: Jun 27 2007
Posts: 55
hi hi,

how about RegEx? i. g.

   var datePattern = /^((([0-2][0-9])|(3[0-1]))\.((0[1-9])|(1[0-2]))\.(([1-9][0-9]{3})|([0-9]{2})))$/;// orvar timePattern = /^((([01][0-9])|([2][0-3]))[:]([0-5][0-9]))$/;

U can restrict user input on this way.
garath
Registered: Mar 24 2009
Posts: 49
You can control user input while he is writing. I described this here:
http://patysie.com/wordpress/?p=6
deepusrp
Registered: Jan 12 2009
Posts: 51
Hello All,

Thanks for all for ur kind replies.

@ Radzmar

When the date entered is not according to the format, it will just make it as NULL. User will be confused why the entered date is not coming. I think there should be a means to make user understand that he is entering a wrong date.

@ Djinges

Where I have to put these regular expressions.

@ Garath

Your solution seems working, but the problem is, its a kind of negation approach. You have to specify all the format which are not correct. I think its difficult.
Moreover, if the user is not aware of the correct format, if he tries to enter in some other format, the script wont allow him to do so. Again he'll be confused.


Thanks