File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Html Textarea queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Html Textarea queries" Watch "Html Textarea queries" New topic
Author

Html Textarea queries

Sunetra Sen
Ranch Hand

Joined: Feb 17, 2005
Posts: 43
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

Joined: Sep 28, 2004
Posts: 1228
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.


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Sunetra Sen
Ranch Hand

Joined: Feb 17, 2005
Posts: 43
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

Joined: Sep 28, 2004
Posts: 1228
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

Joined: Feb 17, 2005
Posts: 43
i tried the \n thingi..
but it doesn't seem to work
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
This works

Sunetra Sen
Ranch Hand

Joined: Feb 17, 2005
Posts: 43
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

Joined: Mar 20, 2005
Posts: 256
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.


Life called,so here I am.<br />Cheers<br />Niki.:-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Html Textarea queries
 
Similar Threads
Result of query in multiple lines
formatting the textarea form field in a servlet
Reading HTML using JAVA
formatting the textarea form field in a servlet
Problem in displaying HTML in flex