Expand my Community achievements bar.

Change style dynamically with javascript and usehref

Avatar

Level 1

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

Level 1

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

Level 1

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).