Here it is explained how to limit the number of files to upload when Allow multi HTML5/Flash uploads checkbox is checked.

Please follow these instructions.

Go to Properties of the "File upload" element in your form and in the Validation section check Required checkbox. Then select Custom as the validation type and in the code area paste in the following:

 

function ff_uploadelementname_validation(element, message)

{

var children = jQuery('.bfFlashFileQueueClass').children();

var len = Number(children.length);

console.log(len);

if ( len > 3) {

if (message=='') message = " Too many files uploaded.\n"

ff_validationFocus(element.name);

return message;

} // if

return '';

}

 

NOTE: In the code above replace uploadelementname with the Name of your File upload element.
This is the example where 3 is the maximum number of files to upload. 

In the following line of code, replace 3 with the maximum number wanted.

That will limit the number of files that can be uploaded.

If a user tries to submit the form with too many files uploaded an error message will be shown and won't be able to submit the form until he reduces the number of uploaded files to less or equal to the maximal.

 

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!