471,338 Members | 1,275 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

inserting text

Is there an example somewhere of a function
that will take 2 parameters: text and a text
object (input type=text or textarea) and insert
that text using the current selection point(s)
for the specified object. The cursor should end
up where you would expect it to and it should
work in both IE and other popular browsers. Is
something like that already floating around?

Thanks.
Dean Hoover

Jul 23 '05 #1
4 1187
In article <Kz******************@twister.nyroc.rr.com>, dhxyz2010
@yahoo.com enlightened us with...
Is there an example somewhere of a function
that will take 2 parameters: text and a text
object (input type=text or textarea) and insert
that text using the current selection point(s)
for the specified object. The cursor should end
up where you would expect it to and it should
work in both IE and other popular browsers. Is
something like that already floating around?


MSIE for Windows, yes. All other popular browsers, including Safari,
Konqueror, Mozilla, IE/Mac, and Opera, no, I don't think so. Last I
checked there was a problem with getting the position of the cursor in
some of those.
Maybe someone has found a way. I'll be watching this thread. :)

--
--
~kaeli~
If that phone was up your a$$, maybe you could drive a
little better!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2


Dean A. Hoover wrote:
Is there an example somewhere of a function
that will take 2 parameters: text and a text
object (input type=text or textarea) and insert
that text using the current selection point(s)
for the specified object. The cursor should end
up where you would expect it to and it should
work in both IE and other popular browsers. Is
something like that already floating around?


See
http://www.faqts.com/knowledge_base/.../13562/fid/130

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #3
Martin Honnen wrote:


Dean A. Hoover wrote:
Is there an example somewhere of a function
that will take 2 parameters: text and a text
object (input type=text or textarea) and insert
that text using the current selection point(s)
for the specified object. The cursor should end
up where you would expect it to and it should
work in both IE and other popular browsers. Is
something like that already floating around?

See
http://www.faqts.com/knowledge_base/.../13562/fid/130

Good one. Thanks.

Jul 23 '05 #4
Martin Honnen wrote:


Dean A. Hoover wrote:
Is there an example somewhere of a function
that will take 2 parameters: text and a text
object (input type=text or textarea) and insert
that text using the current selection point(s)
for the specified object. The cursor should end
up where you would expect it to and it should
work in both IE and other popular browsers. Is
something like that already floating around?

See
http://www.faqts.com/knowledge_base/.../13562/fid/130

I am trying to use what you pointed out to me (cool stuff)
in conjunction with a DHTML menu package I purchased from
apycom.com. The script you gave me fails when used with that
package (on IE only) because the line:

if (range.parentElement() == input)

ends up being false. This is clearly some interaction
with the DHTML menus I am using. I don't really understand
much about these selection objects, as I am reading up on them
in "Dynamic HTML". Is there some way to reset things when this
function is called from the DHTML menu such that it will work
like it does with the example HTML?

Thanks.
Dean Hoover

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by rcoco | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.