tags:

views:

138

answers:

2

I'm new to JSP programming 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,

A: 

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> 
stacker
I think he's trying to display it for the end-user, not for editing purposes. In your answer HTML tags would be displayed, and the end-user will be very confused.
jpabluz
+1  A: 

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.

jpabluz