This is a migrated thread and some comments may be shown as answers.

RadUpload.ClearFileInputAt(i)

1 Answer 48 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
bharathi tenneti
Top achievements
Rank 1
bharathi tenneti asked on 10 Feb 2010, 04:56 AM
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

1 Answer, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 11 Feb 2010, 03:55 PM
What's the value of the index variable and why don't you start the for loop from 0 (zero).
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
bharathi tenneti
Top achievements
Rank 1
Answers by
Vesko
Top achievements
Rank 2
Share this question
or