Disable max character limit on alt text

Last post 03-21-2011, 10:18 PM by Kenneth. 5 replies.
Sort Posts: Previous Next
  •  03-17-2011, 7:27 PM 66727

    Disable max character limit on alt text

    Hi
     
    It appears there is a 72 character limit for alternative text. I get this error:
     
    "The HTML code to be added has reached the character limit for this field: 200. Please reduce the message length to continue."
     
    My client is requiring more characters than that. How can I disable this max character limit?
     
    Also, when selecting an image in the Insert Image dialog or window, it seems to auto populate the width and height of the image. There are times when this is undesirable. How can I disable this auto population?

    Thanks
     
     
  •  03-17-2011, 8:25 PM 66728 in reply to 66727

    Re: Disable max character limit on alt text

    Hi cw808,
     
    "The HTML code to be added has reached the character limit for this field: 200. Please reduce the message length to continue."
     
    Please check your page and remove the MaxHTMLLength property of editor.
     
            <CE:Editor ID="editor1" runat="server" MaxHTMLLength="10">
            </CE:Editor>
     
    Also, when selecting an image in the Insert Image dialog or window, it seems to auto populate the width and height of the image. There are times when this is undesirable. How can I disable this auto population?
     
    1. Open file "r\CuteSoft_Client\CuteEditor\Dialogs\InsertImage.aspx "
     
    2. Add the code below to the end of the page
     
    1. <script>  
    2.   
    3. function do_preview()  
    4. {     
    5.     var f=TargetUrl.value;  
    6.               
    7.     if(f==null)  
    8.     {  
    9.         TargetUrl.value="";  
    10.         f=="";  
    11.     }  
    12.     if(f!=null&&f!="")  
    13.     {  
    14.         var preload;   
    15.         var wait;   
    16.   
    17.         var preload = document.createElement("IMG");   
    18.         preload.src = f;   
    19.           
    20.         function changeImage()  
    21.         {  
    22.             if (preload.complete) {   
    23.                 window.clearInterval(wait);   
    24.                       
    25.                 var foo = new Date();   
    26.                 var now = foo.getTime();    
    27.                   
    28.                 if (f == "")  
    29.                     f = "../images/1x1.gif";  
    30.                   
    31.                 if(f.indexOf("?")!=-1)  
    32.                     f = f+"&time=" +now;  
    33.                 else  
    34.                     f = f+"?time=" +now;                          
    35.                 if(inp_width.value=="0"||inp_width.value=="")  
    36.                 {  
    37.                     inp_width.value = "";  
    38.                     inp_height.value = "";  
    39.                 }  
    40.                 img_demo.src = f;  
    41.                 if(Browser_IsWinIE())  
    42.                     Event_Attach(img_demo,"onmousewheel",OnImageMouseWheel);  
    43.                 img_demo.alt = AlternateText.value;  
    44.                 img_demo.align = Align.value;  
    45.                 img_demo.width = preload.width;  
    46.                 img_demo.height = preload.height;  
    47.                 img_demo.vspace = VSpace.value;  
    48.                 img_demo.hspace = HSpace.value;   
    49.                       
    50.                 if(parseInt(Border.value)>0)  
    51.                     img_demo.border = Border.value;  
    52.                 if(bordercolor.value!="")  
    53.                     img_demo.style.borderColor = bordercolor.value;       
    54.                       
    55.                 f=f.toLowerCase();  
    56.                 if(f.indexOf(".aspx") != -1)  
    57.                 {  
    58.                     img_AutoThumbnail.style.display="none";  
    59.                     if(img_ImageEditor)  
    60.                         img_ImageEditor.style.display="none";  
    61.                 }     
    62.             }  
    63.         }   
    64.           
    65.         wait = window.setInterval(changeImage, 100);   
    66.     }  
    67. }  
    68. </script> 
    Regards,
     
    Ken
     
  •  03-18-2011, 6:23 PM 66751 in reply to 66728

    Re: Disable max character limit on alt text

    Hi
     
    Ok, I've removed the maxhtmllength as you suggested and that is working now. My oversight.
     
    I've added your js to the aspx page and it appears to not be auto populating the image height and width now. However, it still does so if I double click an image and use the IMG editor. Do you have a similar way to disable that auto-population?
     
    I assume I will need to remember to redeploy your js after any cuteeditor upgrade that I perform? Is there a way that this can be implemented as a method or member?
     
    Thanks!
  •  03-21-2011, 1:50 AM 66765 in reply to 66751

    Re: Disable max character limit on alt text

    Hi cw808,
     
    Are you just do not want the user to change its value?
     
    Do you think hide this section (hight and widht) is a good solution for you?
     
    Keep me posted.
     
    Regards,
     
    Ken
     
  •  03-21-2011, 10:16 AM 66773 in reply to 66765

    Re: Disable max character limit on alt text

    Hi
     
    Personally, I don't use img height and width so that the image can be modified outside of the editor. That is the larger issue with the client as well....the client also has ftp access to the same directory structure and is confused at times when they change the image size and upload it via FTP but never update the size in the editor. The website stil dislays the previous size and the image appears distorted so they become confused.
     
    Ideally they should always use the editor to make any changes to the html and objects of the page, but its their requirement of me to keep the FTP open so this is occasionally an issue.

    Thanks
     
     
  •  03-21-2011, 10:18 PM 66787 in reply to 66751

    Re: Disable max character limit on alt text

    Hi cw808,
     
    Hide the width and height section when double click the image
     
    1.Open file "CuteSoft_Client\CuteEditor\Dialogs\Tag\tag_image.ascx "
     
    2. Find section below
     
    1. <tr>  
    2.                                     <td style="white-space: nowrap;">  
    3.                                         [[Width]]:</td>  
    4.                                     <td>  
    5.                                         <input type="text" size="2" id="inp_width" onkeyup="checkConstrains('width');" rem-skipautofirechanged="1"  
    6.                                             onkeypress="return CancelEventIfNotDigit()" style="width: 80px;" />  
    7.                                     </td>  
    8.                                     <td rowspan="2" align="right" valign="middle">  
    9.                                         <img src="Load.ashx?type=image&file=locked.gif" id="imgLock" width="25" height="32"  
    10.                                             title="[[ConstrainProportions]]" /></td>  
    11.                                 </tr>  
    12.                                 <tr>  
    13.                                     <td>  
    14.                                         [[Height]]:</td>  
    15.                                     <td>  
    16.                                         <input type="text" size="2" id="inp_height" onkeyup="checkConstrains('width');" rem-skipautofirechanged="1"  
    17.                                             onkeypress="return CancelEventIfNotDigit()" style="width: 80px;" />  
    18.                                     </td>  
    19.                                 </tr> 
    3. Change to
     
     
    1. <tr style="visibility: hidden">  
    2.                                     <td style="white-space: nowrap;">  
    3.                                         [[Width]]:</td>  
    4.                                     <td>  
    5.                                         <input type="text" size="2" id="inp_width" onkeyup="checkConstrains('width');" rem-skipautofirechanged="1"  
    6.                                             onkeypress="return CancelEventIfNotDigit()" style="width: 80px;" />  
    7.                                     </td>  
    8.                                     <td rowspan="2" align="right" valign="middle">  
    9.                                         <img src="Load.ashx?type=image&file=locked.gif" id="imgLock" width="25" height="32"  
    10.                                             title="[[ConstrainProportions]]" /></td>  
    11.                                 </tr>  
    12.                                 <tr style="visibility: hidden">  
    13.                                     <td>  
    14.                                         [[Height]]:</td>  
    15.                                     <td>  
    16.                                         <input type="text" size="2" id="inp_height" onkeyup="checkConstrains('width');" rem-skipautofirechanged="1"  
    17.                                             onkeypress="return CancelEventIfNotDigit()" style="width: 80px;" />  
    18.                                     </td>  
    19.                                 </tr> 
     
     
     In Image Editor dialog we have not show the width and height  of the image, can you post a screenshot to show which section you mean?
     
    Regards,
     
    Ken
View as RSS news feed in XML