Hi,
it is possible to add in administration settings of chosen an exception list of select field to avoid chosen is applied?
I think this feature is very usefull because in certain case there are too many fields to insert into the apply list than in an exception list.
Thanks

Comments

hydra’s picture

Status: Active » Fixed

Hi!
Iti s alredy possible doing this, using the :not operator as a selector. This could look like this:

:not(.class-of-the-selectfield)

Of course you need to replace the class by the selector matching the seelct field you don't want chosen to apply to.

hydra’s picture

andrea88_b’s picture

Thanks Hydra for the suggestion,
but if i use the :not operator with id of the select field ( :not(#id-of-field) or :not(select#id-of-field) ) the page for administer chosen is empty and module crash.
How can i use an id instead a class for excluding the field?
Thanks

hydra’s picture

Hm actually, this should work like you described. I testet it using the "Minimum number of options" Select field in the admin interface of chosen. First I choosed "alyways apply" and saved, to see if it applyes on this select field. Then I looked into the markup to get the ID of the select element and added it to the textarea. Now it looks like

select:visible
:not(#edit-chosen-minimum)

Chosen is now not applying to the "Minimum number of options" select field anymore.

andrea88_b’s picture

Thanks a lot Hydra, now it is solved with your suggestion.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mrpauldriver’s picture

Issue summary: View changes

Thanks for this suggestion. It helped me resolve a problem with the Webform date popup not working when Chosen is enabled. See https://www.drupal.org/node/2612488