Solved

TextArea specific line value & max number of characters .

Posted on 2002-06-02
10
873 Views
Last Modified: 2013-12-03
Hi

How can I get a specific line(row) value from a TextArea ?

Can I set max number of characters for each line(Row) ?



    Toda.
0
Comment
Question by:kingasa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7049436
You can't get the line value because it does not exist in the object.  The value is a single string.

As for limiting width you can use cols="100" to limit the visible width, but if the user continues to type, it will just wrap to the next line.  

You could use a key event to count the number of key strokes, but it would take a lot of JavaScript to filter the input for things like backspace the cursor keys, enter, tab, etc...

You could get the x,y co-ordinates of the cursor within the window then use some scripting to work out the position within the textarea, if it is absolutely positioned, but thea would not give you the row column position reliably because the user setting will make calculations based on font size impossible.

What is it you are trying to accomplish?  Maybe there is another way.

Cd&
0
 

Author Comment

by:kingasa
ID: 7049448
In one of my applications the user can add comments to a certain action, and then the comment is saved to a database.

The comment can be as long as the user types.

The thing is that the the comment database field can only contain 80 characters.
I can add as many rows as needed for the comment.

in other words I need to take apart the comment and save line by line in the database.

for example:


Action CommentLine CommentText
 1      1           abcd..... (up to 80 characters)
 1      2           efgh..... (up to 80 characters)
 1      3           ijkl..... (up to 80 characters)

 2      1           abcd..... (up to 80 characters)
 2      2           efgh..... (up to 80 characters)
 2      3           ijkl..... (up to 80 characters)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7049468
It would be easier to do it with server side script I think.  If you are updating a database, then it might be easier to break it up in the script you are using.

Client side, you could count the characters and break every 80 characters and put the pieces in a serious of hidden text boxes, but you would still have to make changes on the server side to process the additional fields.

Cd&
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7079430
You still there?

Cd&
0
 

Author Comment

by:kingasa
ID: 7080330
still looking for a solution
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 100 total points
ID: 7080332
Thae fact that no has commented for two weeks should tell you that there is nothing.  You are going to have to process it server side of take another approach.

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 7146391

Hello,

This question has been open for quite a while now and needs to be wrapped up.

EXPERTS: If any of the experts could come back and post any suggestions as to how they feel this could be wrapped up (delete, 0 PAQ, award points, etc), I'm sure the moderators would appreciate it.  If you feel you deserve points here, but don't care to respond, the question might very well get DELETED.

ASKER:  Please return and finalize this question.  Abandoning a question is in violation of the member agreement.

Please do NOT accept this comment as an answer, as I am simply trying to alert those involved that the question is still open.

Thank you,

BRUNO
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7146563
My points. IMHO

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7182436
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to COBOLdinosaur

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7182886
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with mod_substitute 18 44
I'm a Human captcha checkbox 13 43
Navigation Menu Does Not Show on iPad 4 33
Ajax on ASP 2 41
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question