Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to insert at the cursor
fiquebem
I understand that, with the VisualFormat Editor, I can create a button to insert text at the current cursor location. However, I don't want to use VFE if I can help it.
So, I can create a "callout" button next to my text area and use FormAPI to getValue. Then I'm able to append a string (say, " xyz") to the value and finally setValue. But that's hardly adequate. Is there a way to insert "xyz" in the current location of the cursor (with or without FormAPI)?
Thanks,
S.
Find more posts tagged with
Comments
JonathonG
You say, "that's hardly adequate." What exactly is inadequate about the approach you outlined? It seems to me to be a fairly straightforward means of accomplishing your stated goal.
Jonathon
Independent Interwoven Contractor
fiquebem
Hey Jonathon,
Suppose I have typed the following in a text box:
"Once I thought I was . But I was mistaken." After rereading that, I notice that I missed a word, so I move the cursor right before the 1st period. Then I click a callout button to insert a word (say, "wrong") there. I want my sentence to end up reading "Once I thought I was wrong. But I was mistaken." not "Once I thought I was . But I was mistaken. wrong"
Actually, I may be editing my DCR, so I might select some text, perhaps hit Backspace, and click a callout button to insert something there.
In summary, I want to use a callout button to insert text at the current cursor location, the way VFE manages to do it.
Can it be done?
Thanks,
S.
JonathonG
Ok, now I understand what you're looking for.
Unfortunately, I don't know of any way to get the current cursor position from a textarea. A quick glance at a JavaScript reference would seem to indicate that there isn't a way. So, based on that, I don't think its possible to do what you're looking to do. Probably a limitation of javascript/html.
Of course, there's always the chance that I'm overlooking something...
Sorry I couldn't be of more help,
Jonathon
Independent Interwoven Contractor
fiquebem
Thanks for your efforts, Jonathon.
My best alternative after all seems to be VisualFormat.
S.