By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,318 Members | 2,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,318 IT Pros & Developers. It's quick & easy.

Textarea content

P: 3
I have a function on my webpage that inputs content into a textarea. Everytime a button is clicked the information is inputted into the text area. But I'd like to change the format of how it is entered into the textbox. What I'd like to know is, is it possible to have each new input on a new line rather than all being on the same line. like this:

1
2
3
4
5
etc...

Rather than it being inputted like this:

1,2,3,4,5 etc.....



Thanks
Jan 14 '08 #1
Share this Question
Share on Google+
2 Replies


gits
Expert Mod 5K+
P: 5,333
hi ...

you may add a '\n' (linefeed) to the textarea's current content every time you click the button ... please post the code you have so far, so that we have something to work with :)

kind regards
Jan 14 '08 #2

P: 3
hi ...

you may add a '\n' (linefeed) to the textarea's current content every time you click the button ... please post the code you have so far, so that we have something to work with :)

kind regards
I did try to use that '\n' but it didn't seem to work, maybe I put it in the wrong part of my code? I also tried to use CSS to do it but that didn't work either.

My code so far:

Expand|Select|Wrap|Line Numbers
  1.                               function Go_Go(){
  2.  
  3.                   var input1=navigation.url_out.value;
  4.  
  5.                   url1.push(input1);
  6.  
  7.                   navigation.url_out.value=navigation.url_in.value;
  8.  
  9.                   navigation.back_stack.value=url1;
  10.  
  11.                   document.navigation.forward_stack.value='';
  12.  
  13.                   }
So when the button is pushed I would like the data entered to be put on a new line.
Jan 14 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.