Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-08-11 18:25:12

megauser
New member
Registered: 2005-08-10
Posts: 5

Javascript trick needed

Hi!

Is there any way that I can move the cursor around from a javascript? (I mean the cursor in the editor which is in wysiwyg and/or text mode)

Also Does anyone know how to simulate the press of a key or keys (like Ctrl-C) from JS?

Thanks, and keep up the good work!

megaUser

Offline

#2 2005-08-11 18:40:57

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Javascript trick needed

You move the cursor using the selection and range objects.  You'll ave to dig through htmlarea.js to see how to use them, unfortunatly IE and Mozilla do it differently, and it's not documented well by either of the browsers.

It's not possible to actually simulate a "CTRL-C", but you can call the copy command for the editor - see how the copy button in the toolbar works.


James Sleeman

Offline

#3 2005-08-11 18:55:53

megauser
New member
Registered: 2005-08-10
Posts: 5

Re: Javascript trick needed

Thanks!

The CTRL-c was for a workaround. I know how the copy command acts -thanks though

For the cursor moving - Can you give me a sample code on how to to move the cursor from a script to left by one char for example?

Thank You!

Offline

Board footer

Powered by FluxBB