Solved

Question on textarea tag....

Posted on 1998-09-23
1
164 Views
Last Modified: 2010-04-09
Let me explain a little.

I'm trying to create an online application in which I'll be doing some text editing in a textarea tag.  Well, I want to add some tools (buttons) that when clicked on, it will insert predefined text at the cursor position.

I know that I could take the contents and append to it, but that will only put the predefined text at the end of the current text.  I want to be able to insert it anywhere inside the current text, e.g.  I have a textarea that has the content, "There will be no weekly meeting on 9/24/98."  I want to have 5 buttons, each labeled with the day of the week that I could use to insert say, Thursday in between the "on" and the "9/24/98".

If you have ANY information on this, PLEASE let me know.  Thanks all!

---LSILes
les@livingscriptures.com
0
Comment
Question by:LSILes
1 Comment
 
LVL 8

Accepted Solution

by:
jbirk earned 200 total points
ID: 1838056
Well as you may have suspected, this can't be done as you have suggested.  There is no way to know where the cursor is in the textarea, and then as was stated on the other copy of this question (one of them should be deleted), is that once you click on a button the focus is changed and you no longer even have a cursor.  So you can't do anything with the cursor.

If you knew beforehand something about the contents of this text area you could read it in and determine where to insert the new data, and then output the change.

Other than that the best suggestion I have is to output the desired produced text from clicking on a button into a text box, and have the user copy and paste it into where they want it to go.

I'm afraid that's probably the best you can do.
Sorry,
Josh
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

746 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