Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > how to insert text into middle of textarea

Reply
Thread Tools

how to insert text into middle of textarea

 
 
Rick Csucsai
Guest
Posts: n/a
 
      06-21-2005
Here is my dilemma: I have a text area where a user will type in a story. I
want them to be able to hit a button that will insert some text (reference
to an image that I will later parse) into the textarea at the point of the
cursor. Granted, this is easy enough to add something at the end of the text
that the user has already typed but what if I want to insert it into the
middle of pre-typed text. For example:

the user types paragraph 1. Then types paragraph 2. They then decide that
they wanted to insert the image into the middle of paragraph 1. I need for
them to be able to click where they want the insert at in paragraph 1, hit
the insert button, and then once the insert is done, they can continue
typing from where they clicked in paragraph 1.

So how can I tell where the cursor (some call it the caret) is within the
text area? Anyone have any ideas?


 
Reply With Quote
 
 
 
 
Harolds
Guest
Posts: n/a
 
      06-24-2005
Take a look here:
http://www.faqts.com/knowledge_base/...d/1052/fid/130

"Rick Csucsai" wrote:

> Here is my dilemma: I have a text area where a user will type in a story. I
> want them to be able to hit a button that will insert some text (reference
> to an image that I will later parse) into the textarea at the point of the
> cursor. Granted, this is easy enough to add something at the end of the text
> that the user has already typed but what if I want to insert it into the
> middle of pre-typed text. For example:
>
> the user types paragraph 1. Then types paragraph 2. They then decide that
> they wanted to insert the image into the middle of paragraph 1. I need for
> them to be able to click where they want the insert at in paragraph 1, hit
> the insert button, and then once the insert is done, they can continue
> typing from where they clicked in paragraph 1.
>
> So how can I tell where the cursor (some call it the caret) is within the
> text area? Anyone have any ideas?
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
insert javascrpt into textarea? globalrev Javascript 15 05-12-2008 12:03 PM
insert text dynamically into textarea cyprian Javascript 6 07-23-2007 06:25 PM
Insert a string into the text of textarea. Caret? IE question Paul Gorodyansky Javascript 7 02-06-2005 12:14 PM
insert text in textarea Gordan Javascript 0 09-02-2003 05:46 PM



Advertisments