I am using jquery validation plugin for validating my form. I have one file field in form for uploading documents.
<input type="file" name="policyBriefFiles" id="policyBriefFiles" multiple="multiple">
Here is my validation code for this field.
policyBriefFiles: {
extension:'xlsx,pdf',
filesize: 2097152,
},
Now I want users to select maximum two files, but with multiple attribute specified with file user can select any number of files.
How do I restrict users to select maximum two files and no more? Is there any rule available in jquery validation plugin for this? (like maxFile: 2)
I don't mind any other workaround also.