Forum Moderators: open

Message Too Old, No Replies

Add value to a textarea

         

orion_rus

9:42 am on Jan 31, 2005 (gmt 0)

10+ Year Member



Hello world, i need to add tags to a textarea but if i do it with innerHTML, it adds, but not as a text in a textarea, it seems like it simple place it in the textarea statically (i can delete it with del or backspace)
Can anybody advice me another type of adding tags?

lZakl

11:55 am on Jan 31, 2005 (gmt 0)

10+ Year Member



Pardon me if this isn't what you are looking for. I didn't quite understand your question. Are you looking for a simple way to add tags to a textarea? If so:

<html>
<head>

<script language="javascript" type="text/javascript">

function addbold()
{
document.myform.outputtext.value += "<b> </b>";
}

function addit()
{
document.myform.outputtext.value += "<i> </i>";
}

function addbr()
{
document.myform.outputtext.value += "<br>";
}

</script>

</head>
<body>

<form name="myform">
Enter your type here:<br>
<textarea name="outputtext" rows=10 cols=60></textarea><br>
<input type="button" value="<B>" onClick="addbold();">
<input type="button" value="<I>" onClick="addit();">
<input type="button" value="<br>" onClick="addbr();">
</form>

</body>
</html>

That should do :0)

Again, if this isn't what you are looking for, I am sorry.

-- Zak

orion_rus

1:45 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



Yes, i was in need of it) Thank you very much for your help!