June 21, 201313 yr Hey, doing a quick project for my work and can only use html / css etc. No server sided business. Basically i need a textbox that has a button next to it that when clicked, will add the value of the textbox to another text area. So its like this: <INPUT TYPE="text" class="systeminput" NAME="insert" VALUE="";"> <INPUT TYPE="button" class="button" NAME="insert" VALUE="Add Entertainment System" onClick="this.form.textarea1.value=this.form.textarea1.value+??????;"> The question marks is the point where i do not know how to pull the value written into the text box. Any help?
June 21, 201313 yr Hey Lovelock, Pure JavaScript solution: <input type="text" id="myText" name="myText" /> <input type="button" value=" Go! " onclick="document.getElementById('myTextarea').value=document.getElementById('myText').value" /> <textarea id="myTextarea"></textarea> Link to Example: http://jsfiddle.net/5h69j/ Update: jQuery version: http://jsfiddle.net/5h69j/1/ Edited June 21, 201313 yr by Lyndsey added jQuery version
June 21, 201313 yr <html> <body> <form name="f"> <INPUT TYPE="text" class="systeminput" NAME="t" VALUE=""><br> <INPUT TYPE="button" class="button" VALUE="Add Entertainment System" onClick="f.ta.value=f.t.value;"><br> <textarea name="ta"></textarea> </form> </body> </html> Edited June 21, 201313 yr by Lyndsey
Create an account or sign in to comment