Fix for Fix for Disable a form using jQuery, then Renable with a button

  1. Drupal.behaviors.enableSignupEditForm = function(context) {
  2.   var $button = $('#edit-update-signup', context).click(changeValues);
  3.   var $form_elements = $button.parents('form:first').find('input:not(:hidden), textarea, select');
  4.   var original_button_title = $button.val();
  5.  
  6.   $form_elements.attr('disabled', 'disabled');
  7.   $button.attr('disabled', '').val(Drupal.t('Change values'));
  8.   $('#edit-cancel-signup').attr('disabled', '').click(enableCancel);
  9.  
  10.   function changeValues() {
  11.     $form_elements.attr('disabled', '');
  12.     $button.unbind('click', enableForm).val(original_button_title);
  13.     return false;
  14.   }
  15.  
  16.   function enableCancel() {
  17.     $form_elements.attr('disabled', '');
  18.   }
  19. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.