RadUpload.ClearFileInputAt(i)

Thread is closed for posting
2 posts, 0 answers
  1. bharathi tenneti
    bharathi tenneti avatar
    1 posts
    Member since:
    Feb 2010

    Posted 09 Feb 2010 Link to this post

    Hello Telerik Team,

    I used RadUpload to upload 5 documents , also added a custom "textbox" called "Title" to each file.
    Now, before hitting "Upload" button, I want to make sure that "Tilte" has been entered for each file.

    So, I wrote a script function for "OnClientFileselected" , and trying to clear the input when a file is selected 
    without entering "Title".
    Now, I used the upload.clearFileInputAt method. However, its not working if I give any conditions to clear 
    files at specified index like in the below code.

     function clear_file(index) {
                var upload = $find("<%= RadUpload1.ClientID %>");
                var fileInputs = upload.getFileInputs();
                for (var i = 1; i < fileInputs.length; i++) {
                    if (i != index) {                    
                    }
                    else {
                        upload.clearFileInputAt(i);
                    }
                }            
            }

    I got completely lost, why the condition is not working. If i remove the "if- else" then its working and clearing up all inputs.

    Please help me at your earliest convenience.

    Thank you,
    Bharathi
  2. Vesko
    Vesko avatar
    122 posts
    Member since:
    Mar 2009

    Posted 11 Feb 2010 Link to this post

    What's the value of the index variable and why don't you start the for loop from 0 (zero).
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top