CuteWebUI_AjaxUploader_OnBrowse fires twice

Last post 12-05-2013, 8:24 AM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  12-03-2013, 6:02 AM 78487

    CuteWebUI_AjaxUploader_OnBrowse fires twice

    the js function CuteWebUI_AjaxUploader_OnBrowse fires twice in my implementation.

     

    								<CuteWebUI:UploadAttachments runat="server" ID="files" MultipleFilesUpload="false" MaxFilesLimit="1" 
    									ProgressTextTemplate="Processing file.. (%SIZE%)" ProgressPanelWidth="200" 
    									InsertButtonID="btnSelectFiles" ValidateOption-AllowedFileExtensions="Only Word files allowed">
    									<ValidateOption AllowedFileExtensions="doc,docx" />
    								</CuteWebUI:UploadAttachments> 

    <telerik:RadButton ID="btnSelectFiles" runat="server" Text="Select template" CausesValidation="false" /> 

    			function CuteWebUI_AjaxUploader_OnBrowse() {
    			      var templateId = $("input[id$='hTemplateId']").val();
    			      console.log(templateId);  

    } 

  •  12-04-2013, 8:04 AM 78501 in reply to 78487

    Re: CuteWebUI_AjaxUploader_OnBrowse fires twice

    Hi mulmad,

     

    Please try OnSelect, it will fire when use select file. It should can achieve the same as OnBrowse.

     

    1. function CuteWebUI_AjaxUploader_OnSelect(files)  
    2. {  
    3.     //change the files array would take no effect.  
    4.     var name=files[0].FileName;  
    5.     var size=files[0].FileSize // (or -1)  
    6.     //return false to cancel it..  
    7. }  
     

    Regards,

     

    Ken 

  •  12-04-2013, 9:34 AM 78505 in reply to 78501

    Re: CuteWebUI_AjaxUploader_OnBrowse fires twice

    indeed the CuteWebUI_AjaxUploader_OnSelect only fire once.

    However, I'd really like to be able to prompt the user when the clicks the select files button and only after he has select a file.

     

    Is it a know bug that the "OnBrowse" fires twice a bug? (I'm running the latest version)

     

     

  •  12-05-2013, 8:24 AM 78513 in reply to 78505

    Re: CuteWebUI_AjaxUploader_OnBrowse fires twice

    Hi mulmad,

     

    Yes, it should be a bug, I will report to the development team to check it.

     

    Maybe you can try the way below

     

    1. <script type="text/javascript">  
    2.     var count = false;  
    3.     function CuteWebUI_AjaxUploader_OnBrowse() {  
    4.         if (count == false)  
    5.         {  
    6.             alert(1);  
    7.             count = true;  
    8.         }  
    9.     }  
    10. </script>  
     

    Regards,

     

    Ken 

View as RSS news feed in XML