Hi
I have this annoying problem when trying to validate the upload file type.
I got the alert all the time.
This is the code I use:
$(document).ready(function(){
$("#contact-form").kendoValidator();
$("#files").kendoUpload({
multiple: false,
select: onSelect
});
function onSelect(e) {
// Array with information about the uploaded files
var files = e.files;
if (this.extension != ".jpg") {
alert("Only .jpg files can be uploaded")
e.preventDefault();
}
}
});
Regards!
B.
I have this annoying problem when trying to validate the upload file type.
I got the alert all the time.
This is the code I use:
$(document).ready(function(){
$("#contact-form").kendoValidator();
$("#files").kendoUpload({
multiple: false,
select: onSelect
});
function onSelect(e) {
// Array with information about the uploaded files
var files = e.files;
if (this.extension != ".jpg") {
alert("Only .jpg files can be uploaded")
e.preventDefault();
}
}
});
Regards!
B.