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>
精彩评论