1
votes

I have a form with multiple file upload and the file field is required field with at-least one file is required to upload..

<input  type="file" class="upload" name="file[]" multiple required/>

And class upload having on change event function to display list of uploaded files for that field and file type checking purpose.

My problem is on ajax form submit always parsley.validate return false..If i choose files also it returns false.

var check = $('#form').parsley().validate();
alert(check);

Any idea?

2

2 Answers

0
votes

Should work. As always, post a live example

0
votes

you can use this to check number of files in input

if( document.getElementById("uploadFile").files.length == 0 ){
    console.log("no files selected");
}