Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Static, Read-Only Text for License Agreement

Avatar

Former Community Member
How do you create a scrollable drop-down box that is read-only with static text for a software license agreement? The license agreement is rather lengthy, so I want to display the text in a drop-down box that can be viewed by scrolling through the text, if desired.
4 Replies

Avatar

Former Community Member
Maybe I'm not getting this.



I tried a simple small text field, set it to 'allow multiple lines' and to read only and I see exaclty the effect that you want, albeit with a text field not a drop down field.



What am I missing?



/gerold

Avatar

Former Community Member
Thanks for responding, Gerold. The problem I have is entering the text of the license agreement. The text field allows "multiple lines" and "read-only", but the text entered in the "default value" field does not provide word-wrapping, formatting, or a way to enter a carriage return. To enter the license agreement as a single string of characters in the "default" value field would require hours and hours of re-typing.



I need a box to contain a lengthy legal agreement (read-only) that the user can scroll through, if desired (e.g., software installation license agreement with a check-box for "I agree"). I want to copy the existing text from an ascii text file and paste it into a text-box that displays the first 8 lines of the text with scroll bars.



What am I missing?

Avatar

Level 6
Hello Steve,



I think I've got it. See the sample at

http://www.jlangdon.ca/SteveGraham/SteveGraham.pdf



The text field accepts rich text. I have a form variable called strLicense, which contains XHTML. On initialize, the field loads the XML using:

this.resolveNode("value.#exData").loadXML(strLicense.value,false,true);



The only problem was that when I make the field read only, the scroll bars don't appear. So, on exiting the field, I reset the value again using the same line of code. That way if the user changes the contents of the field, it changes itself back. Maybe someone else can improve on this approach.



Hope this helps.



Jared Langdon

http://www.jlangdon.ca

Avatar

Former Community Member
Jared, thank you very much! I really appreciate your help.



Have a happy and safe New Year.



Steve