开发者

How to display agreement text in a TextArea?

开发者 https://www.devze.com 2022-12-20 03:54 出处:网络
I\'m new to JSP progra开发者_如何学Cmming and I\'m wondering how can I display license agreement text in a text area? When I read it as a String and display it - the formatting of new lines and number

I'm new to JSP progra开发者_如何学Cmming and I'm wondering how can I display license agreement text in a text area? When I read it as a String and display it - the formatting of new lines and numbering of points is all lost. Or is there any other way of showing this text?

Thanks,


Well, a good option, would be to use a div instead of a text area, which will be formatted with HTML, that could be entered in a WYSIWYG text area, like the one in stackoverflow.

You could use the CSS

div.license-agreement
{
    width: 600px; // SET AS YOU WISH
    height: 200px; // SET AS YOU WISH
    overflow:scroll;
}

To get the scrolling bars in the DIV.


You could add you licence text with javascript including HTML bullet points etc.

<script>
    function addContent() {
        document.getElementById("YourTextAreaId").innerHTML= "<p>Some HTML stuff</p>";
        }
</script> 
0

精彩评论

暂无评论...
验证码 换一张
取 消