Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with changing text in textarea

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm having problems add text from a text field to a textarea
originally I was just trying to change the value but in the future I would like to add additional text.

here is my code.

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 3.2 Final//EN&quot;>
<HTML>
<HEAD>
<SCRIPT LANGUAGE='JavaScript'>
<!--

user = 'Name';
messagetext = 'Message';


function AddToBoard(){

user = document.Msg_Form.UserName.value;
messagetext = document.Msg_Form.NewText.value;
user = user + messagetext;
textObj = document.Msg_Board_Form.MsgBoard;
textObj.value = user;
}


-->
</SCRIPT>

<TITLE></TITLE>
</HEAD>

<BODY BGCOLOR=&quot;#FFFFFF&quot; TEXT=&quot;#000000&quot; LINK=&quot;#FF0000&quot; VLINK=&quot;#800000&quot; ALINK=&quot;#FF00FF&quot; BACKGROUND=&quot;?&quot;>

<div align=&quot;center&quot;>
<FORM NAME=&quot;Msg_Board_Form&quot; onSubmit=&quot;AddToBoard();&quot;>
<TEXTAREA NAME=&quot;MsgBoard&quot; ROWS=&quot;50&quot; COLS=&quot;65&quot; readonly onFocus=&quot;this.blur()&quot;></TEXTAREA>
</FORM>
<br><br><br><br>

<FORM NAME=&quot;Msg_Form&quot;>
<table>
<tr>
<td>Name:</td>
<td>
<INPUT NAME=&quot;UserName&quot; TYPE=&quot;text&quot; VALUE=&quot;[Name]&quot; SIZE=&quot;40&quot; MAXLENGTH=&quot;40&quot;>
</td>
</tr>
<tr>
<td>Message:</td>
<td>
<TEXTAREA NAME=&quot;NewText&quot; ROWS=&quot;8&quot; COLS=&quot;40&quot; WRAP=&quot;virtual&quot; value=&quot;&quot;>[Message]</TEXTAREA>
</td>
</tr>
<tr>
<td></td>
<td>
<INPUT TYPE=&quot;button&quot; NAME=&quot;submit&quot; VALUE=&quot;Submit&quot; onClick=&quot;AddToBoard();&quot;>
</td>
</tr>
</table>
<br>
</FORM>
</div>
</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top