Techno
04-21-2006, 11:24 AM
Hi.
I have a small client side script which simply, when you click on a button, it appends text to a textbox on the page.
however I want to be able to keep the formatting the way it is without having it to reformat it in its own way.
for example, if i have several blank lines (enter key pressed) in the textbox, as soon as you hit the button to append some text, it will reformat it, to make the line in one big long sentence instead of keeping its formatting.
hope it makes sense:
<script type="text/javascript">
function DoAppendText(theText)
{
theTextbox = document.getElementById('txtThreadMessage');
theTextbox.innerHTML += theText;
}
..
..
<input id="cmdBold" style="WIDTH: 42px; HEIGHT: 24px" onclick="DoAppendText('{b}{/b}')" type="button" value="B" name="cmdBold" runat="server">
</script>
I have a small client side script which simply, when you click on a button, it appends text to a textbox on the page.
however I want to be able to keep the formatting the way it is without having it to reformat it in its own way.
for example, if i have several blank lines (enter key pressed) in the textbox, as soon as you hit the button to append some text, it will reformat it, to make the line in one big long sentence instead of keeping its formatting.
hope it makes sense:
<script type="text/javascript">
function DoAppendText(theText)
{
theTextbox = document.getElementById('txtThreadMessage');
theTextbox.innerHTML += theText;
}
..
..
<input id="cmdBold" style="WIDTH: 42px; HEIGHT: 24px" onclick="DoAppendText('{b}{/b}')" type="button" value="B" name="cmdBold" runat="server">
</script>