Expand my Community achievements bar.

Default LiveCycle text to disappear

Avatar

Level 1

I need to add instructional default text to a text field and have it disappear when the cursor is clicked into that field, but have it reappear if nothing is entered in the field

5 Replies

Avatar

Level 4

Try this. Open the script window and add the following:

 

(1)  In the initialize event of the field, add the following javascript:

 

this.execEvent("exit");

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

 

 

(2) In the enter* event of the field, add the following javascript:

 

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

            this.font.posture = "normal";

 

(3) In the exit* event of the field, add the following javascript:

 

if (this.isNull){

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

            this.font.posture = "italic";

            this.caption.font.fill.color.value = "0,0,0";

            this.caption.font.posture = "normal";

   

Once that is entered, go to the object palette, and select the Accessibility tab. In the tool tip field, type in the guidance you want to provide the user in filling out this field. Preview the form and see if that helps.

rg

Avatar

Level 8

Hi lateniteNC,

I found this by chance, and I just wanted to say "Thank you". This is so cool

Tarek

Avatar

Former Community Member

I have the same question and cannot figure it out. Inputting all of that script did not help sadly and I am not familiar with script.

Avatar

Level 2

Hello,

You could also try (with no script), if the field is a text field, go to object, filed and patterns, there on the display tab check "allow empty" and insert your explanation text in the enabled field.