Expand my Community achievements bar.

setting attributes of text/input fields at runtime


Former Community Member
I am currently defaulting some text to an input field at the docReady event by checking to see if the InpField1.rawValue = NULL.

What I would like to do now is either turn the background fill color to gray or to make the field read only until the user clicks on it to enter their text.

Using the Click event, I'd like to revert the color to normal or set the mode to input when they click to enter their text.

How can I set the attribute of the input field? I see setAttribute but i'm not sure which attributes can be set if any, at runtime.

thanks alot.
1 Reply


Former Community Member

I assume InpField1.rawValue = NULL is pseudo-code.

Try the following in the initialize event of InpField1:

To set the color to grey

InpField1.ui.oneOfChild.border.fill.color.value = "190,190,190";

To set the access to read only

InpField1.access = "readOnly";

To reset access to user entered optional change the access property to "open" on the enter event.

Many examples can be found here