earth4x Posted April 6, 2006 Share Posted April 6, 2006 Ok here's my problem!!!I have a textarea which I enter some numbers in and then my program transforms those numbers into a javascript arrays, checks some stuff and then gives me back the numbers... then I want to re-insert back into the textarea.. which works fine except I want a \n after every number... so logically I put a table.join command so that after each number there's a \n.. but it just doesn't work!!! chaineNotesValides = tValeursTriees.join("\n"); champNotes.innerHTML = chaineNotesValides;here you can see the 2 things that join the \n and then put the info in the textarea... problem is my numbers come out like so :50 60 70 80 90and if I change \n to let's say % it does this :50%60%70%80%90it works.. but why doesn't it make a \n like i'm asking it to?.. can someone help :/ Link to comment Share on other sites More sharing options...
Little Goat Posted April 6, 2006 Share Posted April 6, 2006 I've seen it done like this: a="\n"document.forms[0].textarea.value=yourarray[1]+a+yourarray[2]+a I'm not positive but that might work.LG Link to comment Share on other sites More sharing options...
Little Goat Posted April 7, 2006 Share Posted April 7, 2006 ignore post :)mods remove this post? Link to comment Share on other sites More sharing options...
Webworldx Posted April 10, 2006 Share Posted April 10, 2006 Yup, you want textarea.value not textarea.innerHTMLand \r\n join might also help, provide a carriage return then a line feed 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