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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a textbox value or listbox value to a textarea

Status
Not open for further replies.

gglgokop1704

Programmer
Aug 9, 2007
54
GB
Please how do I add a textbox value or listbox item toi a textarea at run time dynamically.

I want to have a button called 'Add' and when I type a value in a text box or I select an item from a list box and I click the Add button, it should add the textbox value or the lixtbox item to the textboxarea.

Any help is appreciated
Gokop
 
it's unclear if you're asking if to treat as 2 separate entities (textbox/selectbox) or IF a user selects both what info goes into the textarea..here is a simple demo to get whatever ws entered into a textbox to a textarea...aply to selectbox as needed too...otherwise a function may be in order...let us know

Code:
<form name="frm1" action="page1.htm" method="post">
  <input name="input1">
  <textarea name="textarea1"></textarea>
 <input type="button" onclick="textarea1.value=input1.value" value="Add">
</form>
 
Hi bslintx ,

Thanks for your response. Yes separate entities. That is if I type a value in a textbox and click the Add button, it should send the value to a textarea and on the other hand if I select an item from a listbox and click another Add button it should send the value to another textarea. Sorry for my poor communication. I hope it makes some sense now.

Kind regards
Gokop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top