[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

TextArea specific line value & max number of characters .

Posted on 2002-06-02
10
Medium Priority
?
876 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
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!

 
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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
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.…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

649 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