Re: Cannot validate contents of hidden CuteEditors

  •  10-08-2010, 4:43 AM

    Re: Cannot validate contents of hidden CuteEditors

    Hi JPenn,
     
    If you want to replace the tab part with div, please try the example below. You still can get the content of editor if use "
    visibility: hidden".
     
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5. <html xmlns="http://www.w3.org/1999/xhtml">  
    6. <head runat="server">  
    7.     <title>example</title>  
    8.   
    9.     <script runat="server">  
    10.         protected override void OnLoad(EventArgs e)  
    11.         {  
    12.             editor1.Text = "Is editor1";  
    13.             editor2.Text = "Is editor2";  
    14.             base.OnLoad(e);  
    15.         }  
    16.     </script>  
    17.   
    18. </head>  
    19. <body>  
    20.     <form id="theForm" runat="server">  
    21.     <div id="div1" style="visibility: hidden">  
    22.         <CE:Editor ID="editor1" runat="server">  
    23.         </CE:Editor>  
    24.     </div>  
    25.     <div id="div2">  
    26.         <CE:Editor ID="editor2" runat="server">  
    27.         </CE:Editor>  
    28.     </div>  
    29.     <input type="button" value="GetEditor1Content" onclick="getEditor1Content()" />  
    30.     <input type="button" value="GetEditor2Content" onclick="getEditor2Content()" />  
    31.     </form>  
    32. </body>  
    33. </html>  
    34.   
    35. <script>  
    36. function getEditor1Content()  
    37. {  
    38.     var editor1=document.getElementById("<%= editor1.ClientID %>");  
    39.     alert(editor1.getHTML());  
    40. }  
    41. function getEditor2Content()  
    42. {  
    43.     var editor2=document.getElementById("<%= editor2.ClientID %>");  
    44.     alert(editor2.getHTML());  
    45. }  
    46. </script> 
     
    Regards,
     
    ken
View Complete Thread