Forum Moderators: phranque

Message Too Old, No Replies

Text box in text are question!

         

MySpaceFTP

1:13 am on Aug 31, 2005 (gmt 0)

10+ Year Member



I need some help. this should be simple code, i just cant figure out what it is. I need my users to be able to type information in multiple text boxes, and have it display in the text area when they click the submit button. Any help would be great. Thanks in advance!

example:

[text box]

[text box]

[ ]
[text area]
[ ]

[submit]

mcavill

8:09 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



if you're not doing anything server side, and just want it to be merged text in the textarea you can do it client side using javascript which will be quicker for the user and place no load on your server.

Something like this might work:

<html>
<head>
<script language="javascript" type="text/javascript">
function mergeText(){
var sTemp;
sTemp = document.forms['myForm'].input1.value + " " + document.forms['myForm'].input2.value;
document.forms['myForm'].myText.value = sTemp
}
</script>
</head>
<body>
<form name="myForm">
<input type="text" name="input1">
<br>
<input type="text" name="input2">
<br>
<textarea name="myText"></textarea>
<br>
<input type="button" onClick="JavaScript:mergeText();" value="submit">
</form>
</body>
</html>

Hope that's of some help.

MySpaceFTP

11:01 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



That is exactly what i needed. Thanks alot, that was a huge help!