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

RadUpload in Radgrid FormTemplate: Client-Side Validation

2 Answers 96 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Clarence
Top achievements
Rank 1
Clarence asked on 07 Jan 2009, 05:15 PM
Hi,
    Does anyone know of a way to validate a RadUpload that is located inside of a RadDrid's FormTemplate via JavaScript.  I want to validate these two things: 1) That the RadUpload contains a file. 2) That the RadUpload's File contains a valid extensions.  I have looked at some tutorials for Client-Side validation, but none show how to validate a control within the FormTemplate.

Thanks in advance,
Clarence

2 Answers, 1 is accepted

Sort by
0
Mahesh
Top achievements
Rank 1
answered on 06 Sep 2012, 09:21 AM
We are having the same problem , please provide the solution to this issue.

Thanks,
Mahesh
0
Bozhidar
Telerik team
answered on 10 Sep 2012, 10:17 AM
Hi Mahesh,

You can check whether the upload control has a file uploaded with the following code:
if ($telerik.findControl(document, "RadAsyncUpload1")._uploadedFiles.length > 0)
...

As for the file extension validation, you can use RadAsyncUpload's AllowedFileExtensions property. A demonstration on how to use the property can be found in the following demo:
http://demos.telerik.com/aspnet-ajax/upload/examples/async/validation/defaultcs.aspx?product=asyncupload 

Regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Upload (Obsolete)
Asked by
Clarence
Top achievements
Rank 1
Answers by
Mahesh
Top achievements
Rank 1
Bozhidar
Telerik team
Share this question
or