Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

simple text field highlighting question

Avatar

Level 3

Hi guys

I have a form with a text field where the user enters their initials.

To bring the field to the user's attention, I have highlighted the portion of the field where the user would type.

When they click into the text field, I would like this highlighting removed.

Can that be done?

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Yes, the following in the enter event would work:

var vName = this.somExpression; // gets the full SOM expression for the object...
var fieldObj = xfa.resolveNode(vName);

var fld = fieldObj.ui.resolveNode("#textEdit"); // see ui codes below
fld.border.fill.color.value = "255,255,255";


/* Check the type of object and change the .ui reference:

    Date field =         #dateTimeEdit 
    Dropdown =        #choiceList 
    Checkbox =        #checkButton 
    Text field =         #textEdit 
    Numeric field =    #numericEdit

*/

A similar script is in the exit event, with an if statement to see if a value has been inputted.

Hope that helps,

N.

ps a word of caution, different fonts can vastly increase the file size. Try Myriad Pro, which is more efficient...

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi,

Yes, the following in the enter event would work:

var vName = this.somExpression; // gets the full SOM expression for the object...
var fieldObj = xfa.resolveNode(vName);

var fld = fieldObj.ui.resolveNode("#textEdit"); // see ui codes below
fld.border.fill.color.value = "255,255,255";


/* Check the type of object and change the .ui reference:

    Date field =         #dateTimeEdit 
    Dropdown =        #choiceList 
    Checkbox =        #checkButton 
    Text field =         #textEdit 
    Numeric field =    #numericEdit

*/

A similar script is in the exit event, with an if statement to see if a value has been inputted.

Hope that helps,

N.

ps a word of caution, different fonts can vastly increase the file size. Try Myriad Pro, which is more efficient...