We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
gpfup-count-files.js
experimental
1 parent e21b59b commit a5a36f0Copy full SHA for a5a36f0
gp-file-upload-pro/gpfup-count-files.js
@@ -0,0 +1,17 @@
1
+jQuery(function() {
2
+ // Update "123" to your form ID and "4" to your File Upload field ID.
3
+ if (typeof window['GPFUP_123_4'] === 'undefined') {
4
+ return;
5
+ }
6
+
7
8
+ var store = window.GPFUP_123_4.$store;
9
10
+ store.subscribe(function(mutation, state) {
11
+ if (mutation.type !== 'SET_FILES') {
12
13
14
+ // Update "5" to your Single Product field ID - or - update `#input_123_5_1` to your desired input's HTML ID.
15
+ jQuery( '#input_123_5_1' ).val( state.files.length ).change();
16
+ });
17
+});
0 commit comments