• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

To add outer text in middle of any text area.

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am making an application in which there is text area, where I insert some text. And there are few buttons representing some symbols to be added in the text area(Like we add Instant Graemlins in JavaRanch-Add New Topic, but it is appended to the text). I want to add in middle of text or at starting or at the end of text. How to deal with this.
with regards
Pashmina
 
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pashi,

But check for Browser-Compability, i only tested it in IE
ps: remove '_' from e_val and the smiley you see are : + ) and : + D
[ May 09, 2003: Message edited by: Christian Baron ]
Making it so the smiles disappear and no need for _ with the clicks - Eric
[ May 10, 2003: Message edited by: Eric Pascarello ]
also removed _ in eval now
[ May 10, 2003: Message edited by: Christian Baron ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OOOPS...first post here was wrong...too many open windows!
Just to let you know
when you use the words with an o thaty give you trouble replace them with o
onclick="smile";
Eric
[ May 09, 2003: Message edited by: Eric Pascarello ]
 
Pashi Soni
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Christian,
The code is working fine if I have to add some content at the end of the text in the text area. The actual problem is, I want to put the content whereever the cursor is in the text area, and not at the end of the text. Please give some more suggestions
with regards
Pashmina
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is IE only since IE is the only one that uses the caret position...Are you using IE??
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a link that explains how this works. It is to another forum I post on.
http://www.codingforums.com/showthread.php?s=&threadid=12235
Eric
 
Pashi Soni
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Eric,
Yeah I am working on IE-6. The link you have provided have one text area and 3 buttons, but it is not working in IE. What will work in IE then ?
regards
Pashmina
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it works, he has the buttons set up for adding text around a selection. The image button I think works for the caret postion.
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
in ie6.0 my code works... inserting at cursor position. I would never steal *erm* adapt so much code just to add some Chars at the end .
I removed _ from e_val, just copy and paste and try again.
cb
 
Pashi Soni
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Eric,
Yeah it worked. Well I think it will help me to do R&D further, since I want to add a text on cursor position. For the above program u suggested, adds text when a selection is made. I want it to add, even if selection is not made, just the cursor has to be in the text area.
regards
Pashmina
 
reply
    Bookmark Topic Watch Topic
  • New Topic