A
aqualizard
I have a Content Management SYstem that allows users to modify
code/content through a standard "<textarea>" text box. Sometimes, when
they select text (to copy, delete, etc.) they grab on to partial HTML
tags. This causes confusion and messes up the updates they make.
Is there a way to check a selected text range, and if it has a partial
tag selected, to change the selection automatically to the complete tag
or no tag?
Specifically, upon mouseup when a selection is made, check if the
leftmost and rightmost selections include "><", in which case the
selection will be reduced by 1 char (on whichever side) so the partial
tag is not included.
It only needs to work in IE 5.5+. (Intranet with uniform PC setups.)
I have no problem reading selected text, and determining if it contains
partial tags, the problem is in modifying the selected/highlighted text
in the textarea.
Thank you,
A.L.
code/content through a standard "<textarea>" text box. Sometimes, when
they select text (to copy, delete, etc.) they grab on to partial HTML
tags. This causes confusion and messes up the updates they make.
Is there a way to check a selected text range, and if it has a partial
tag selected, to change the selection automatically to the complete tag
or no tag?
Specifically, upon mouseup when a selection is made, check if the
leftmost and rightmost selections include "><", in which case the
selection will be reduced by 1 char (on whichever side) so the partial
tag is not included.
It only needs to work in IE 5.5+. (Intranet with uniform PC setups.)
I have no problem reading selected text, and determining if it contains
partial tags, the problem is in modifying the selected/highlighted text
in the textarea.
Thank you,
A.L.