Validation for type of file that I upload in form


I have a form:

[code]//creating form
clientFormData = [
{ type: “fieldset”, name: “fieldsetConfig”, label: translate(‘client’), list:[
{ type:“settings” , labelWidth:200, inputWidth: “auto”},
{ type:“input”, label: translate(‘client_name’),
name:“name”, width:175, inputLeft:10, inputTop:15},
{ type:“input”, label: translate(‘client_description’),
name:“description”, width:175, inputLeft:10, inputTop:15},
{ type:“input”, label: translate(‘email’),
name:“email”, width:175, inputLeft:10, inputTop:15},
{ type:“input”, label: translate(‘phone’),
name:“phone”, width:175, inputLeft:10, inputTop:40},
{ type:“input”, label: translate(‘contact_person’),
name:“contact_person”, width:175, inputLeft:10, inputTop:65},
{ type:“dhtmlxUploadFile”, inputWidth: 330, url: dhtmlxUploadFile,
name:“img_logo”, titleText: translate(“drag_n_drop_files_here_or_click_to_select_files_for_upload”)},

//attaching form
formClient = tabbar.cells(“tabConfig”).attachForm(clientFormData);

//live validation

Can I set validation so I can upload only png,gif,jpeg? It is something already implemented, or do have to make a custom function?


default “type:file” doe not have any validations, only custom
for “type:upload” you can use onBeforeAdd event and do not allow to add files into list

Thanks for your answer!