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

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

Level 1

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