Solved

TextArea specific line value & max number of characters .

Posted on 2002-06-02
10
871 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
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML code not showing slider block in Magento 2 39
FIELDSETs and LEGENDs in email markup 1 23
html input type 3 31
Scroll 5 news at a time. 4 25
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

775 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