diff options
Diffstat (limited to 'misc/form.js')
-rw-r--r-- | misc/form.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/misc/form.js b/misc/form.js index f5e3e6846..d3a9f692f 100644 --- a/misc/form.js +++ b/misc/form.js @@ -1,10 +1,12 @@ // $Id$ -Drupal.behaviors.multiselectSelector = function() { - // Automatically selects the right radio button in a multiselect control. - $('.multiselect select:not(.multiselectSelector-processed)') - .addClass('multiselectSelector-processed').change(function() { - $('.multiselect input:radio[value="'+ this.id.substr(5) +'"]') - .attr('checked', true); - }); +Drupal.behaviors.multiselectSelector = { + attach: function(context) { + // Automatically selects the right radio button in a multiselect control. + $('.multiselect select:not(.multiselectSelector-processed)', context) + .addClass('multiselectSelector-processed').change(function() { + $('.multiselect input:radio[value="'+ this.id.substr(5) +'"]') + .attr('checked', true); + }); + } }; |