diff misc/form.js @ 1:c1f4ac30525a 6.0

Drupal 6.0
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:28:28 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/form.js	Tue Dec 23 14:28:28 2008 +0100
@@ -0,0 +1,10 @@
+// $Id: form.js,v 1.1 2007/09/12 18:29:32 goba Exp $
+
+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);
+  });
+};