crazyboybert
Programmer
Hi
I have an HTML editor written for IE using the execCommand method and associated functionality. M$oft seem to think that it is possible to nest lists (or any elements for that matter) as far as you like though I ma having problems with this.
To insert an unordered list for example the following code is used..
this works fine and turns selected text into a list element or creates an empty list if no text is selected. If the same code is ran again whilst the cursor is on a list item the selected item is switched back to plain text when what i would like is for the a new nested list to be created and for backspace to be used to end a list...
i have tried adding an id to created elements using
but this seemingly doesnt work at all though its documented as right and throws no errors. I figured if each list had its own unique ID then maybe it would list them instead of operating on the selected list but no such joy..
Anybody got this to work or experienced similar probloems and foudn a workaround?
Cheers up front for any help at all
Rob
------------------------------------
Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon
------------------------------------
I have an HTML editor written for IE using the execCommand method and associated functionality. M$oft seem to think that it is possible to nest lists (or any elements for that matter) as far as you like though I ma having problems with this.
To insert an unordered list for example the following code is used..
Code:
document.execCommand('insertunorderedlist');
this works fine and turns selected text into a list element or creates an empty list if no text is selected. If the same code is ran again whilst the cursor is on a list item the selected item is switched back to plain text when what i would like is for the a new nested list to be created and for backspace to be used to end a list...
i have tried adding an id to created elements using
Code:
document.execCommand('insertunorderedlist', false, sID);
but this seemingly doesnt work at all though its documented as right and throws no errors. I figured if each list had its own unique ID then maybe it would list them instead of operating on the selected list but no such joy..
Anybody got this to work or experienced similar probloems and foudn a workaround?
Cheers up front for any help at all
Rob
------------------------------------
Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon
------------------------------------