Problem: I have added some custom JavaScript to a Toolset Form so that I can limit the number of selections in a multiselect field, and also deactivate some other inputs. It was working correctly until recently, and I'm not sure why it is broken now.
Solution: Looks like at least two issues here:
1. Resolve the jQuery namespace error by wrapping all $ references in a jQuery document ready callback that receives $ as a parameter:
jQuery(document).ready(function($){ $(".js-example-basic-multiple-limit > div > select").select2({ placeholder: "Selecciona categoría", maximumSelectionLength: 3 }); });
Next you must exclude some files from Autoptimize's minification process. The list of those files can be found at the link below.
Relevant Documentation:
https://toolset.com/forums/topic/what-files-to-exclude-from-wp-rocket/
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by 5 years ago.
Assisted by: Christian Cox.