• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Html Textarea queries

 
Sunetra Sen
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I would like to do the following with an html textarea which I want to use to display a large chunk of out to the user on the UI:
1) Allow the user to copy the text displayed in the textarea but prevent him from deleting.
2)Display the contents line by line not all in a single line.

Is there any way in which I can achieve these?

Thanks in advance,
Sunetra.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Allow the user to copy the text displayed in the textarea but prevent him from deleting.

Try with readonly attribute. It works with textFields but not sure about text area.
 
Sunetra Sen
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works with textFields but not sure about text area.


It works with the textarea also.Thanks!

Anyone any idea about the other question?

Thanks in advance,
Sunetra.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Text area normally shows the data in multipile lines, if the text being displayed in the textarea has a "\n" character in it.
 
Sunetra Sen
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried the \n thingi..
but it doesn't seem to work
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This works

 
Sunetra Sen
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the situation is something like this:
I am getting the output of a batch file as an input stream in my servlet.I have a xml in which i have a tag like <result></result> in which I put the whole output.
Now I apply xsl and display this on the textarea.Here I want to break up the output from the batch file while displaying on the textarea into lines.
But am not able to do that.
Any help??
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you know where you need the newline then just insert "\n" there.

if the situation is something else then i havent got what you neeed exactly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic