diff --git a/includes/flag.admin.inc b/includes/flag.admin.inc
index 1f0e797..65f6156 100644
--- a/includes/flag.admin.inc
+++ b/includes/flag.admin.inc
@@ -406,15 +406,23 @@ function flag_form($form, &$form_state, $name, $type = NULL) {
     '#access' => empty($flag->locked['link_type']),
   );
 
-  $form['link_options'] = array(
+  $form['display']['link_options_intro'] = array(
+    '#markup' => '<p id="link-options-intro">' . t('The selected link type may require these additional settings:') . '</p>',
+    '#weight' => 20,
+  );
+
+  $form['display']['link_options_confirm'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Link options'),
-    '#description' => t('The selected link type may require these additional settings.'),
-    '#attributes' => array('id' => 'link-options'),
+    '#title' => t('Options for the "Confirmation form" link type'),
+    // Any "flag link" provider module must wrap its settings fields with an
+    // HTML ID of link-options-LINKTYPE, where LINKTYPE is the machine-name
+    // of the link type. This is necessary for the radiobutton's JavaScript
+    // dependency feature to work.
+    '#id' => 'link-options-confirm',
     '#weight' => 21,
   );
 
-  $form['link_options']['flag_confirmation'] = array(
+  $form['display']['link_options_confirm']['flag_confirmation'] = array(
     '#type' => 'textfield',
     '#title' => t('Flag confirmation message'),
     '#default_value' => isset($flag->flag_confirmation) ? $flag->flag_confirmation : '',
@@ -422,7 +430,7 @@ function flag_form($form, &$form_state, $name, $type = NULL) {
     '#access' => empty($flag->locked['flag_confirmation']),
   );
 
-  $form['link_options']['unflag_confirmation'] = array(
+  $form['display']['link_options_confirm']['unflag_confirmation'] = array(
     '#type' => 'textfield',
     '#title' => t('Unflag confirmation message'),
     '#default_value' => isset($flag->unflag_confirmation) ? $flag->unflag_confirmation : '',
@@ -553,10 +561,6 @@ function flag_expand_link_option($element) {
     if (isset($element['#option_descriptions'][$key])) {
       $element[$key]['#description'] = $element['#option_descriptions'][$key];
     }
-    // Add a list of fields dependent on this link type using the rel attribute.
-    if (isset($element['#flag_link_fields'][$key])) {
-      $element[$key]['#attributes']['rel'] = implode(' ', $element['#flag_link_fields'][$key]);
-    }
   }
   $element['#attributes']['class'] = array('flag-link-options');
 
diff --git a/theme/flag-admin.js b/theme/flag-admin.js
index f67e583..cbb2c1e 100644
--- a/theme/flag-admin.js
+++ b/theme/flag-admin.js
@@ -47,26 +47,29 @@ Drupal.behaviors.flagRoles.attach = function(context) {
  */
 Drupal.behaviors.flagLinkOptions = {};
 Drupal.behaviors.flagLinkOptions.attach = function(context) {
-  $('.flag-link-options input.form-radio', context).change(function() {
-    var radioButton = this;
-    $('#link-options').slideUp(function() {
-      $('#link-options input').each(function() {
-        $(this).parents('.form-item:first').css('display', 'none');
-      });
-      var linkOptionFields = $(radioButton).attr('rel');
-      if (linkOptionFields) {
-        linkOptionFields = linkOptionFields.split(' ');
-        for (var n in linkOptionFields) {
-          $('#link-options input[name=' + linkOptionFields[n] + ']').parents('.form-item:first').css('display', 'block');
+  $('.flag-link-options input.form-radio', context).change(function(event, speed) {
+    // Reveal only the fieldset whose ID is link-options-LINKTYPE,
+    // where LINKTYPE is the value of the selected radio button.
+    var $radioButton = $(this);
+    var $relevant    = $('fieldset#link-options-' + $radioButton.val());
+    var $irrelevant  = $('fieldset[id^=link-options-]').not($relevant);
+
+    if ($irrelevant.size()) {
+      $irrelevant.slideUp(speed, function() {
+        $('#link-options-intro').hide();
+        if ($relevant.size()) {
+          $('#link-options-intro').show();
+          $relevant.slideDown(speed);
         }
-        $('#link-options').slideDown();
-      }
-    });
-  });
+      });
+    }
+    else {
+      $('#link-options-intro').show();
+      $relevant.slideDown(speed);
+    }
+  })
   // Hide the link options by default if needed.
-  if (!$('.flag-link-options input.form-radio:checked').attr('rel')) {
-    $('#link-options').css('display', 'none');
-  }
+  .filter(':checked').trigger('change', [ 0 ]);
 };
 
 /**
