Arcader Posted April 12, 2007 Share Posted April 12, 2007 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 More sharing options...
smiles Posted April 12, 2007 Share Posted April 12, 2007 do you mean a flash variable interact with html textarea Link to comment Share on other sites More sharing options...
Arcader Posted April 18, 2007 Author Share Posted April 18, 2007 No, I'm talking about html javascript. I'm trying to in the javascript file have it start a new line but it won't, I need some help. Link to comment Share on other sites More sharing options...
pulpfiction Posted April 18, 2007 Share Posted April 18, 2007 Try \r\n\n for New Line and \r for Return. Use both to work in IE.reason="title:"+\r\n+"paragraph" Link to comment Share on other sites More sharing options...
jesh Posted April 18, 2007 Share Posted April 18, 2007 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 More sharing options...
pulpfiction Posted April 18, 2007 Share Posted April 18, 2007 Yeah, \n works for me too. but this site below says something about \r\n......http://www.rgagnon.com/jsdetails/js-0001.html Link to comment Share on other sites More sharing options...
jesh Posted April 18, 2007 Share Posted April 18, 2007 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 More sharing options...
Arcader Posted April 19, 2007 Author Share Posted April 19, 2007 oh thats what I needed a document.getElementById("id").value="" thanks this works alot better. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now