Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Question on textarea tag....

Posted on 1998-09-23
1
Medium Priority
?
193 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 400 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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…

782 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