Chosen gives me no effect on any page. Javascript seems to load as I can find mentions of chosen in page source. It's applied to select:visible. Also tried
.form-select for one page. Tried clearing cache. Yes the library is in libraries/chosen/chosen

Any suggestions?

Comments

vladsavitsky’s picture

The same problem. CSS and JS is on page but not working.
And there is no "Apply Chosen to the following elements" option.

brianfisher’s picture

ditto, using drupal 7.15 and chosen 1.0 or 1.x-dev

also, am getting js error that causes a WSOD, which I've never seen happen client-side before, on pages like node/%node/edit

HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy
/misc/jquery.js?v=1.4.4
Line 116
shadcn’s picture

I'm running Drupal 7.15 but unfortunately, cannot reproduce the error. Can you see if there are any other conflicting module or theme js?

JRZ-2’s picture

Same for me

Absolutey nothing happens.

shadcn’s picture

What selector are you using?

JRZ-2’s picture

I'm using select:visible, and always apply.
other issue I have is that it sometimes makes some collapsible fields (e.g. in edit content types, manage fields) unavailable...
thanks

RealGecko’s picture

Same for me with Drupal 7.18, Chosen 7.x-2.x-dev from 2013-Jan-15 and Chosen JavaScript file 0.9.11. No effect on any of selects. Chosen module config is default.
PS: Same with 7.x-1.0 version with Garland and Bartik themes.

Infoloko’s picture

Again similar BUT depends on browser => Firefox (18.0) .. works perfectly but Chrome (24.0.1312.52 m) .. nothing. This is with both browsers on screen at same time and to identical web pages.

Criteria select:visible and always apply.

Drupal 7.18, Chosen 7x-1.0 and chosen.jquery.min.js 0.9.9

Sk8erPeter’s picture

Are there any error messages (JavaScript-exceptions) on your browser's console? Press F12 or Ctrl+Shift+I and click "Console" tab before you refresh your page.

RealGecko’s picture

I`m using Firefox 18.0 under ArchLinux and as far as can see there are no any error reports.

shadcn’s picture

I'm still not able to reproduce this error. Tested with the latest Drupal 7.18 - 7.19 and chosen.

Please make sure you:

  1. Download and correctly place the chosen library under sites/all/libraries/chosen
  2. Set the minimum options.
  3. Use the correct selector.
  4. Check your console for errors (as suggested in #9)
JRZ-2’s picture

Sorry but, what's the exact path ?

sites/all/libraries/chosen

or

sites/all/libraries/chosen/chosen

Do we need only :

chosen.jquery.min.js ?

chosen.jquery.js?

or everything :

chosen-sprite.png, chosen.css, etc ?

thanks !

Sk8erPeter’s picture

the latter, sites/all/libraries/chosen/chosen

sites
  └───all
    └───libraries
      └───chosen
        ├───chosen
          ├───chosen-sprite.png
          ├───chosen.css
          ├───chosen.jquery.js
          ├───chosen.jquery.min.js
          ├───chosen.proto.js
          └───chosen.proto.min.js
        └───coffee
          └───...
Do we need only :
chosen.jquery.min.js ?
chosen.jquery.js?
or everything :
chosen-sprite.png, chosen.css, etc ?

You need all the files, but why does it disturb you? :)

1140’s picture

Version: 7.x-1.x-dev » 7.x-2.0-alpha1

At first, thanks for this great module. IMHO the only way to get the correct cross-browser results.

Everything is working fine here. Only Firefox shows a scrollbar when dropdown is active.

Chosen 7.x-2.0-alpha1
Drupal 7.19

Chrome 25.0.1364.97 m
Firefox 19.0
Opera 12.14
IE 9.08122.16421
Safari 5.17 (7534.57.2)

Like @Sk8erPeter wrote:

1. The path to save the files has to be this one.

└───all
└───libraries
└───chosen
├───chosen
├───chosen-sprite.png
├───chosen.css
├───chosen.jquery.js
├───chosen.jquery.min.js
├───chosen.proto.js
└───chosen.proto.min.js
└───coffee
└───...

2. The "Minimum number of options" has to set to "always apply" (/admin/config/user-interface/chosen).

3. The select id has to be the right one (here again /admin/config/user-interface/chosen). I´m using the module to style the select lists in the "Add to cart form" in Commerce. Simply search the source of the site to find the id.

Hope it will help.

shadcn’s picture

Status: Active » Closed (works as designed)

Still unable to reproduce this. Please refer to the steps described above by @1140.

Jonesgr’s picture

I just observed that, in my case, chosen.js is loaded before jquery.js.. This doesnt happen in 7.x-1.0.

Edit: We can change the weight of the javascript here :

  drupal_add_js(drupal_get_path('module', 'chosen') . '/chosen.js',
    array('type' => 'file', 'scope' => 'footer', 'weight' => JS_DEFAULT)
  );

But then another error came up here:

width : ($(this).width() < minWidth) ? minWidth : $(this).width()
          }).chosen(options);

Last edit: As far as I can see, libraries/chosen isn't loaded...