Skip to main content
This topic has been closed for replies.
Correct answer George_Johnson

// Custom Format script for text field

if (!event.value) {

event.value = "Text goes here";

event.target.display = display.noPrint;

} else {

event.target.display = display.visible;

}


Change that format script to:

// Custom Format script for text field

if (event.value === event.target.defaultValue) {

    event.value = "Text goes here";

    event.target.display = display.noPrint;

} else {

    event.target.display = display.visible;

}

Set the default value of the field to "Please provide ", and you might want to add the following custom Validate script:

if (!event.value) {

    event.value = event.target.defaultValue;

}

2 replies

Bernd Alheit
Community Expert
Community Expert
February 10, 2016

You can use the property Tooltip for the instructions.

Participating Frequently
February 10, 2016

Hi juliaf71725967,

Would request you to please elaborate you workflow,what changes  you are looking for in the field information so that we can help you more effectively.

Regards,

Yatharth 

Participant
February 10, 2016

I have a JavaScript written to allow "Ghost Text" or placeholder text that disappears in the field when the user completes it.  The placeholder text is instructions, for example "Write Out Number." 

However, I want to also allow Default text to appear when the user attempts to fill out the form (upon selection of the field, the ghost text disappears but the default text appears).  The default text is required information, such as "Please provide" xxxx.  The user is required to fill out the xxx with the written number, but the "Please provide" is required by the person accepting the form.

Tooltips are not viable, as the users are not familiar with hovering.

Inspiring
February 10, 2016

You will also have to consider the formatting of the field because fields with a format like number, date or time cannot accept alphabetical characters so gray instructions could not appear in the field. If one makes all fields with a format of "None" then you need to use custom scripting to perform all validation for entered data like dates and numbers. And a lot of this work will need to be redone when summing a number of fields.

You might want to first see how a simple form works and then work on adding the more advanced features.