Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Question on textarea tag....

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…
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…

670 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