Tell us what you are trying to do?
Limit the number of checkboxes allowed for a specific CPT. I have two CPT's - CPT-1 and CPT-2. Both of these CPT's use a checkboxes field called "states". I want to limit the number of checkboxes allowed for CPT-1. CPT-2 would not have a limit.
I did not see the JS Editor on the post form and was going to insert using a snippet tool outside of Toolset.
To clarify, if I enter the code into the JS editor for CPT-1, will it only work for CPT-1? The field slug would be changed to "Listing" to match the slug for Listing. However, the field has the same slug for CPT-1 and CPT-2.
What I am trying to do is have a common field in both CPT's to use for a filter for both CPT's in the same view. Will this work?
I entered the code into the JS Editor for the post form for CPT-1, and it only limits the check boxes for CPT-1 and not CPT-2. So this looks like it does what I want.
Will this same code work for a taxonomy? By changing the slug to match the slug of the taxonomy/
Thanks for the update and glad that it is working.
And yes, the same code will work for taxonomy term checkboxes too. You'll just have to replace the custom field key ( e.g. 'wpcf-tipo-de-massagem' ) with the taxonomy's slug ( e.g. 'category' ).