I need the following features preferably in a texarea but a div would work also. (Actually, I don't really care what the element might be as long as I can get this functionality on a web page).

  1. Ability to get or set selected text by starting and ending row/column.
  2. Vertical text selection

Imagine this text in a textarea:

John Smith     01/01/1980
Virgina     10%
Arizona     12%

And a list with the following info:

Field          Start Row Col   End Row Col
-------------- --------- ---   ------- ---
Customer Name          1   1         1  15
Company                2   1         2  20
States                 4   1         5  11

I need to be able to click on Customer Name in the list and then "select" the area indicated between the 2 points. Like wise, if the user picks an item on the list, then selects an area of text, I need to update the location values on the list.

To make things worse, the third item in the list spans multiple rows, but the selected data cannot include percentages (this is what I meant by vertical text selection... same behavior as Alt+Dragging in VS or Notepad++).

Any recommendations on how to do this would be awesome. I've been exploring options for a couple of days and I can't find any jquery plugins that can do either of these things.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.