Hi,
Can we use TAB key to actually insert TAB space inside WebHtmlEditor ????
Tab key should insert 2 spaces (which are ). In case of Mozilla it is default behavior of browser and in case of IE the WebHtmlEditor does that manually. If you want to modify that behavior, then you can do that only for IE. For example, you may insert 3 spaces on Tab key by processing ClientSideEvents.KeyDown and
function WebHtmlEditor1_KeyDown(oEditor, keyCode, oEvent){ if(oEditor._ie && keyCode == 9) { iged_insText(" "); oEvent.cancel = true; }}
Hi Savio,
In case of not IE-browsers, the object can be inserted at caret, but not text-string. However, the text node ("#text") does not support html tags, so, string like " " will be inserted explicitly. It is possible to create a SPAN and set its innerHTML to that value, but in case of webkit (Chrome/Safari) the browser may insert further content typed-in by end user inside of that SPAN rather than outside (Firefox is ok).So, basically application is limited to a single explicit space-character.
Below are codes for you:
function WebHtmlEditor1_KeyDown(oEditor, keyCode, oEvent){ if(keyCode == 9) { var tab = ' '; if(!oEditor._ie) { tab = document.createTextNode(' '); //var span = document.createElement('SPAN'); //span.innerHTML = tab; //tab = span; } oEditor.insertAtCaret(tab); // instead of 8 lines above, the commented lines below can be used as well //if(oEditor._ie) // iged_insText(tab); //else // iged_insNodeAtSel(document.createTextNode(' ')); oEvent.cancel = true; }}