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

textarea

Status
Not open for further replies.

Maximus007

Technical User
Jul 26, 2004
248
US
I have a list box that the user is able to select names from. Then they click the add button to move the selected name to a textarea. Here's how the names are appearing
Example: Name1Name2Name3

How can I have the next name move to the next line? Here's the code I am using to move them over.

function AddEmployees(){


var Display=document.getElementById("Display")
var option=Display.options[Display.selectedIndex].text
var txt=document.getElementById("Employees").value
txt= txt + option
document.getElementById("Employees").value=txt
}
 
in it's most simplistic form (without me getting carried away with changing your code), try this:

Code:
txt += ("\n" + option);



*cLFlaVA
----------------------------
spinning-dollar-sign.gif
headbang.gif
spinning-dollar-sign.gif

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top