Expand my Community achievements bar.

How to change appearance of textField?

Avatar

Former Community Member
Hi,



I set the appearance of a textField to 'sunken box'.

Unfortunately, after changing its background-color using the following line of JavaScript code, the 'sunken box' appearance is gone. It's replaced by the 'solid box' appearance.




xfa.resolveNode("#subform[0].#field[0]").border.fill.color.value = "183,0,0";





So, is there a way to maintain the 'sunken box' appearance after having changed the background-color of a textField?



Regards,

Steve
2 Replies

Avatar

Former Community Member
Is there a way to set the appearance of a field using JavaScript?

Like




xfa.resolveNode("myField").appearance = "sunken box";



?

:-)

Avatar

Former Community Member
It's not quite that simple as there's no direct support in the scripting object model for this. When you change those setting in the UI many changes are made to the XML. It makes changes to the border node, as well as the child edge nodes as to whether or not they are present in the XML, as well as modifying attributes on those nodes. You could see what changes are made by looking at the field in the XML source, then changing the appearance in the UI and looking at the new XML, and so on. You'd then have to perform all those changes manually in your script in order to achieve this.



Chris

Adobe Enterprise Developer Support