Jump to content

Textarea problems


Arcader

Recommended Posts

I made a varible in flash that is called reasonwell I have a program set up so that varible reason is displayed in a textarea.The only problem is that when I try to add in a new line it won't let me.reason="Title: \n paragraph"orreason="title:"+\n+"paragraph"the point is I want it to look like when i'm on the webpage:TitleParagraphBut it doesn't, so could some one help me.

Link to comment
Share on other sites

I don't know if you're using IE and .innerHTML or not, but this seems to work for me in both Firefox and IE:

// doesn't work in IE://document.getElementById("mytextarea").innerHTML = "title:\nparagraph:";// works in both IE and Firefox:document.getElementById("mytextarea").value = "title:\nparagraph:";

Link to comment
Share on other sites

Yeah, \n works for me too. but this site below says something about \r\n......http://www.rgagnon.com/jsdetails/js-0001.html
I think you're right that \n\r is better, but I believe the issue here is that .innerHTML was being used instead of .value. So, my post revised would look like this:
document.getElementById("mytextarea").value = "title:\n\rparagraph:";

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...