Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adding Ghost Text to LiveCycle Designer forms


Level 1

Hi to all

i am new to coding and have been set a task of setting up a pdf form, but it requires ghost text to guide the users but also to allow them to type normal text when they fill in the form, so greyed out text for the ghost and black text for the completed field, but i have very little experience with coding and could do with some advice below is an examle of the text field i have in and would love to know what it is that i have to add to get this to work.

<field name="KnownMedicalConditions" y="76.2mm" x="66.675mm" w="127mm" h="6.35mm">



                     <border presence="hidden">

                        <?templateDesigner StyleID aped0?></border>




               <font typeface="Calibri" size="9pt">


                     <color value="153,153,153"/>



               <margin topInset="0mm" bottomInset="0mm" leftInset="1mm" rightInset="1mm"/>

               <para vAlign="middle"/>


                  <font typeface="Calibri" size="9pt"/>

                  <para vAlign="middle"/>




                     <text name="formatTest"/>




                  <speak disable="1"/>



            <?templateDesigner expand 1?></subform>

         <?templateDesigner expand 1?></subform>

      <subform w="576pt" h="756pt">

         <breakBefore targetType="pageArea" startNew="1"/>

         <draw name="G30" x="146.05mm" w="31.75mm" h="12.7mm" y="3.228mm">


4 Replies


Level 10

Hi there,

I suggest you do not edit XML to put a ghost text for your textfield
instead modify its properties using the object's field properties..

In Design View, select the textfield and go in Object > Field Palette > Patterns...

Within Pattern Display, check Allow Empty's box, and enter the ghost text in the textbox below..

This will act as ghost text, if you want to change font's color to grey when empty,

you should initially set the font's color to grey,

when you enter the field change it back to black and

if you exit the field and the field's value is null, reset the color to grey.

I hope this will help!


Level 3

Hi, just found this answer. Great tip, exactly what I was looking for. Thanks.


Level 8

Use the code sample below to implement Ghost Field (placeholder):

I hope this will be helpful.

//form1. # subform[0].TextField1::initialize - (JavaScript, client)


//form1. # subform[0].TextField1::enter - (JavaScript, client)


//form1. # subform[0].TextField1::exit - (JavaScript, client)


//form1. # variables[0].myTools - (JavaScript, client)

//Ghost field processing (placeholder)

function initGhost(theFld, ghostText) {

ghostText = ghostText || theFld.assist.toolTip.value;

theFld.format.picture = "null{'" + ghostText + "'}";



function enterGhost(theFld) {

var oFill = xfa.form.createNode("fill");



theFld.font.posture = "";


function exitGhost(theFld) {

var oColor;

var oFill;

if (theFld.isNull) {

  oFill = xfa.form.createNode("fill");

  oColor = xfa.form.createNode("color");

  oColor.value = "192,192,192";




  theFld.font.posture = "italic";