Solved

TextArea specific line value & max number of characters .

Posted on 2002-06-02
10
870 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordpress url rewriting plugin 5 46
HTML CSS 7 38
Asp.net mvc foreach 3 35
How are Button Fonts Created? 2 15
This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now