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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

change color edges textfield

Avatar

Level 5

Hi All.

Is possible to change color only horizontal edges for TextFields by condition in JavaScript?

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Assuming you are talking about the border around the UI part of the text field (not the border around the while widget) and you have already set the border style to one of the ones what allows colors (not one of the 3D styles) then you can use this code to set the top and bottom border colors (in this case to red)

var topBorderEdge = TextField1.ui.oneOfChild.border.getElement("edge", 0);

var bottomBorderEdge = TextField1.ui.oneOfChild.border.getElement("edge", 2);

topBorderEdge.color.value = "255,0,0"

bottomBorderEdge.color.value = "255,0,0"

Regards

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

Assuming you are talking about the border around the UI part of the text field (not the border around the while widget) and you have already set the border style to one of the ones what allows colors (not one of the 3D styles) then you can use this code to set the top and bottom border colors (in this case to red)

var topBorderEdge = TextField1.ui.oneOfChild.border.getElement("edge", 0);

var bottomBorderEdge = TextField1.ui.oneOfChild.border.getElement("edge", 2);

topBorderEdge.color.value = "255,0,0"

bottomBorderEdge.color.value = "255,0,0"

Regards

Bruce

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now