Solved

TextArea specific line value & max number of characters .

Posted on 2002-06-02
10
869 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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…

744 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

13 Experts available now in Live!

Get 1:1 Help Now