Hi,
I'm using a form to a multiselect widget. It shows up alright, but you can't select any data.
My field looks like
$form['item_category'] = array(
'#type' => 'multiselect',
'#title' => t('Main categories'),
'#description' => t('Please choose the relevant categories for this entire source.'),
'#options' => _item_options_categories(),
'#default_value' => isset($source_config['item_category']) ? $source_config['item_category'] : '0',
'#multiple' => TRUE,
'#size' => 10,
'#required' => FALSE,
);
And my options like:
<select size="10" id="feeds[FeedsAffiliateHTTPFetcher][item_category]" class="form-multiselect feeds[FeedsAffiliateHTTPFetcher][item_category]_unsel multiselect_unsel multiselect-processed multiselect-unsel-processed" multiple="multiple" name="feeds[FeedsAffiliateHTTPFetcher][item_category]_unsel">
<option value="nono">None</option>
<option value="23">Books & entertainment</option>
<option value="24">- Books</option>
<option value="26">- DVD & movies</option>
<option value="25">- eBooks</option>
<option value="27">- Music</option>
<option value="29">- Video games</option>
..etc..
</select>
The + / - buttons show in Firebug:
<li id="feeds[FeedsAffiliateHTTPFetcher][item_category]" class="multiselect_add multiselect-add-processed"><a href="javascript:;">Add</a></li>
Empty javascript? I get no error messages whatsoever in Firebug. Clicking text & buttons just doesn't do anything.
Comments
Comment #1
Anonymous (not verified) commentedI'm getting this notice in Firebug:
FF3.6 & IE8
Comment #2
attheshow commentedI'm not able to duplicate this using the snippet of code above. Maybe post your full module file?
Comment #3
Anonymous (not verified) commentedOk I noticed the issue may be the css class name. Whichs in my case is like
class="items[FeedsHTTPProcessor][config] (...)"If I hack it and use a class without square brackets [], then it seems ok. I think jQuery has issues with this kind of CSS classes? Then Feeds module is the problem.
PS My module file is very simple. It's just a kind of hook_form_alter() to change a Feeds module HTTPFetcher settings form.
Comment #4
Anonymous (not verified) commentedHi, in the function _multiselect_build_widget_code() we create the CSS classes from
$element['#field_name']. But sometimes, at least with Feeds module forms, this name looks likefeeds[HTTPFetcher][categories].Problem is, jQuery can't handle [ ] in css class names and breaks multiselect.
SOLUTION:
change:
to:
This works and solves my problem.
Comment #5
mparker17multiselect-7.x-1.8 is no longer supported, because Drupal 7 is no longer supported.
Can you confirm if this is still an issue in multiselect-2.0.0-beta4?
I'm going to mark this issue as "Postponed (maintainer needs more info)"... but when you answer, please change it back to "Active". If there is no reply in ~6 months, then I will mark this issue as "Closed (outdated)". Thank you in advance for your understanding and patience as I try to keep this module's issue queue clear.