Count number of files in form

By: Andreu de Haro | Asked: 02/18/2024
ForumsCategory: Code SnippetsCount number of files in form
Andreu de Haro asked 10 months ago

Hello,   Do you know how can I count number of files in a form? I want to use this for calculate a number of files. People have to pay a fee for every file.   I've read this awesome article, but I don't know why the file count doesn't work for me (always shows 0) 

https://www.fdmdigital.co.uk/formidable-forms-file-upload-add-ons/

 

1 Answers
Rob LeVineRob LeVine answered 10 months ago
In your browser console, you can see that the script (written several years ago, now has errors).  As a quick test, I removed the file names part of the script (keeping only the file counting) and made some changes to get by the errors and it works fine for me. https://paste2.org/W0abKvme  
Andreu de Haro replied 10 months ago

Thank you!

In the other hand, I've found another solution. I've create a repeat section and include a hidden field with a number 1. After that, outside the repeat section, I've added a text field with a sum of the hidden fields.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right