Menu + IE7+ overrides document.selection ?

Hi,
I’ve come to weird situation. I use textarea to enter text, and dhtmlxMenu to pick various formating options, like “BOLD”, “ITALIC” etc … in Chrome and FF it works just fine, but in IE, the text replacement doesnt work - it always appends the tags to the end of the text, not on the current caret/highlight text position. I was able to track down, that when I call the function that puts the bold tags around my textarea highlighted text, from a button, it works in IE. But when I call it from dhtmlxMenu, it doesnt work, because its unable to detect the beginning and the end of the text. When digging more deeply into

jquery.fieldSelection.js

script im using, i came to conclusion, that “document.selection” is overriden by the Menu. Is it really so, and is there any possibility to avoid this ?

Hi,

try to use the following solution in order to solve the problem with selection:

[code]…
menu.loadXML(url,function(){

menu.forEachItem(function(id){
	menu.setItemText(id, "<a href='javascript:void(0);' style='color:inherit;cursor:default;text-decoration:none;outline:none;'>"+menu.getItemText(id)+"</a>");
});

});[/code]

great solution, thanks alot ! just one minor thing - it works now, if user clicks on TEXT in menu item, but if he clicks anywhere else on the menu row, it behaves “the old way”, overriding the document.selection … any clue ?

thank you for your great support !