Skip Navigation

[Résolu] Limiting checkbox selection not working when minified

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.

This topic contains 2 réponses, has 2 voix.

Last updated by Tom Gonzales Il y a 2 années et 3 mois.

Assigned support staff: Christian Cox.


I am trying to: add a form to post to a custom post type, and in the form I want to limit the about of categories they can select within the form. I can get it to work when I unminify the page - hidden link

Link to a page where the issue can be seen: hidden link

I expected to see: only allow up to 3 checkboxes selected in the section titled Categories. When the page is minified, it doesn't work, but when I select to unminify the page, it does. Where is the JS I added to the form stored so maybe I can just remove that from being minified when the page loads?

Instead, I got: JS added to form to limit the number of categories checked doesn't work when page is minified.


Christian Cox

Languages: Anglais (English )

Timezone: America/New_York (GMT-04:00)

Hi, the JavaScript you add to a Form editor is actually injected into the page markup, so there's not a specific file you can exclude from minification. In general, we recommend you do not attempt to minify or obfuscate any Toolset code, as it could have unexpected results.


Hi Chris - Since minifying CSS and JS files, I make it a point to check all pages to make sure things are still working properly, and this was the first instance of something not working the way it should. But the tool I'm using for minification (Hummingbird) allows me to unminify specific pages as needed using '?avoid-minify=true' at the end of the page URL. So I just set up a redirect to the original page URL with the added browser instructions and it's working fine now.

Thanks for your help!