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 problem with text area tabspace Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "problem with text area tabspace" Watch "problem with text area tabspace" New topic
Author

problem with text area tabspace

Divya Guttikonda
Ranch Hand

Joined: Mar 09, 2005
Posts: 47
Hi,
I have a textarea as follows.

textarea name="message" wrap="virtual" value=""

When i use this code i see that for the first time itself the textarea is not empty and has extra tab spaces.It has value like "\t\t\t\t\t\t\t\t..." .The tabs(\t) are automatically in textarea even before i enter any data.I am trying to get rid of these tabs for the first time.Can anybody help me??
Ashish K Sharma
Ranch Hand

Joined: Aug 22, 2006
Posts: 31
Hi,
Need more info about your prob to have a better idea.
You can always trim the value anyways.
Check you onload function or any other code whether you are doing something with textarea on startup.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8147
    
  52

textarea name="message" wrap="virtual" value=""


This is not the correct way of using the textarea element. The 'value' attribute wont make a difference to the contents seen in the textarea. You create textarea as follows:


This will show the 'some text value' string as the contents of the textarea.
So, in your case, make sure you dont have any spaces/tabs between the opening <textarea> tag and the closing </textarea>


[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8147
    
  52

The other alternative that you have is to clear the contents of the textarea during the onload of the body. Here's an example:

Divya Guttikonda
Ranch Hand

Joined: Mar 09, 2005
Posts: 47
Thanks everybody.I worked out for me trying to clear out the data in body onload() function.Actually i thought it is related to wrap="virtual" attribute that i have used.I figured it out that it is not related to wrap attribute.Anyways thanks a lot for your replies.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: problem with text area tabspace
 
Similar Threads
JTextArea & TextArea
My SCJP Preparation Notes
jQuery UI tabs not loading in the same tab
\t size in java
removing newline and tabs from a string