## Ghost text is changing the caption to gray italics

mdawn50

Total Posts

346

Likes

8

6

mdawn50

Total Posts

346

Likes

8

6
mdawn50

08-05-2015

I'm using this script:

form1.page17.table1.Table7.Row3.DateField6[0]::enter - (JavaScript, client)

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

this.font.posture = "normal";

form1.page17.table1.Table7.Row3.DateField6[0]::exit - (JavaScript, client)

if (this.isNull)

{

this.fontColor = "153,153,153"; // a gray colour

this.font.posture = "italic";

form1.page17.table1.Table7.Row3.DateField6[0]::prePrint - (JavaScript, client)

this.format.picture.value = "";

form1.page17.table1.Table7.Row3.DateField6[0]::postPrint - (JavaScript, client)

this.format.picture.value = "";

this.execEvent("exit");

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

That I gratefully found at this blog: Adding Ghost Text to LiveCycle Designer forms on the adobe.cookbooks.com web site.

I can get the ghost text to work just fine, however when I just used it in a TextField, it changes the caption to the gray italic text. What is causing this and how do I correct?

Thanks,

MDawn

#### Accepted Solutions (0)

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

372

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

372
_Bruce_Robertson
MVP

12-05-2015

Hi Margaret,

Sorry about that, mouslander is right the line "this.caption.font.posture.value = "normal";" should have been "this.caption.font.posture = "normal";" without the .value bit

If you want to do this in Designer, you can with the Font palette.

Click the little arrow and update the Value to italic and the 40% gray (153,153,153) and set the caption to black, normal.

Regards

Bruce

mouslander

Total Posts

298

Likes

23

27

mouslander

Total Posts

298

Likes

23

27
mouslander

11-05-2015

try this:

this.fontColor = "250,153,15"; //Change the font to a color

this.caption.font.fill.color.value = "0,0,0"; //Change the Caption to black

this.caption.font.posture = "normal" //change the caption to normal

this.font.posture = "normal" //change the value to normal

this.font.weight = "bold" //change the value to bold

mdawn50

Total Posts

346

Likes

8

6

mdawn50

Total Posts

346

Likes

8

6
mdawn50

11-05-2015

Thank you for this solution. It does correct the color, but the text is still italics.

You mention setting the characteristics in the UI, but I’m not sure where to do that.

Thanks,

MDawn

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

372

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

372
_Bruce_Robertson
MVP

10-05-2015

Hi,

Setting the fontColor (which is the same as font.fill.color.value) will update the font color for the value and, if there is no specific color for the caption will update that as well.

You can either set the color for the caption in the UI, or add the following code to the ready:form event (which sets the caption font to black, normal)

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

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

Regards

Bruce
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9651742577552795, "perplexity": 8810.492374323097}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703528672.38/warc/CC-MAIN-20210121225305-20210122015305-00109.warc.gz"}