textbox for uploaded files

2 posts, 0 answers
  1. beeta one
    beeta one avatar
    63 posts
    Member since:
    Aug 2012

    Posted 27 Sep 2012 Link to this post

    hii,
    want to adda textbox to every uploaded files in a RadAsyncUpload to enter some additional info. Can anybody please help me to achieve this scenario.


    thanks.....
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Sep 2012 Link to this post

    Hi Hash,

    Try the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" OnClientFileUploaded="onClientFileUploaded" MultipleFileSelection="Automatic">
    </telerik:RadAsyncUpload>

    JS:
    <script type="text/javascript">
         var $ = $telerik.$;
     
         function onClientFileUploaded(radAsyncUpload, args) {
             var $row = $(args.get_row());
             var inputName = radAsyncUpload.getAdditionalFieldID("TextBox");
             var inputType = "text";
             var inputID = inputName;
             var input = createInput(inputType, inputID, inputName);
             var label = createLabel(inputID);
             $row.append("<br/>");
             $row.append(label);
             $row.append(input);
         }
     
         function createInput(inputType, inputID, inputName) {
             var input = '<input type="' + inputType + '" id="' + inputID + '" name="' + inputName + '" />';
             return input;
         }
     
         function createLabel(forArrt) {
             var label = '<label for=' + forArrt + '>File info: </label>';
             return label;
         }
    </script>

    Please take a look into this for more information.
    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top