Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Change style dynamically with javascript and usehref

Avatar

Former Community Member

Hello guys,

I'm using Livecycle designer and I'm trying to dynamically change the style of a TextField with javascript.

In the xml windows i've noticed the assigned style is stored in the usehref tag.

However if I try somthing like that in the "click" event of a button :

TextField.usehref = ".#som($template.#subform.designer__stylesheet.TextFieldStyle)";

This makes the TextField disappear.

Perhaps i'm doing something wrong, or maybe I have to somehow reload the layout ?

Thanks !

5 Replies

Avatar

Former Community Member

Hi again,

I think I was not clear enough. Basically I have a textfield assigned with a style, let's say TextFieldStyle1. What I want is to programmatically assign the textfield another style, say, TextFieldStyle2.

How can I achieve that ?

Many thanks !

Avatar

Former Community Member

I'm too looking for a solution to that problem. UP !!!

Avatar

Former Community Member

C'mon people, this is a pretty basic thing, there has to be an easy way to do this.

Please help !

Avatar

Level 1

I'm frustrated to admit that I too can't seem to solve this one.

Avatar

Level 10

There is no way to change the usehref property at runtime I believe as it is only referenced once at the template load time (the moment when the form is opened).