Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Tue, 21 Aug 2007 13:08:03 -0700,    group: microsoft.public.inetsdk.programming.scripting.jscript        back       


MSHTML myElem.document.execCommand("RemoveFormat"); doesnt work   
Sorry if this is not the best place to post this problem. Basically In my 
editor once a user selects a paragraph and selects from a style from a list, 
it is sent to the function f which calls document.ExecCommand('formatblock', 
false,'<h1>'). If the user selects the same text again and selects a diff 
heading style then instead of removing the prev h1 tag it wraps the whole 
paragraph with h2 tag. so it looks like <h2><h1> text </h1></h2>

 

var myElem = document.getElementById(MyControls[myArea]); // my area is the 
textarea

myElem.focus();


if (myControl.selectedIndex==1){   // user selected H1

myElem.document.execCommand('formatblock', false, '<h1>');

}else if (myControl.selectedIndex==2{   // User seletced H2

myElem.document.execCommand("RemoveFormat");

myElem.document.execCommand('formatblock', false, '<h2>'); 

}

 

 

You guys know how to fix this? I have been stuck on it for ages. Any help 
will be much appreciated.
date: Tue, 21 Aug 2007 13:08:03 -0700   author:   Pasha

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us