Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6034 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Form.Element.Methods.disable and Form.Element.Methods.enable are switched

Reported by: dresselm@businesslogic.com Assigned to: madrobby
Priority: normal Milestone: 1.x
Component: Prototype Version:
Severity: normal Keywords: form enable disable
Cc:

Description

The Form.Element.Methods.disable function enables a form element, whereas the Form.Element.Methods.enable function disables a form element.

HTML:

<input type="button" id="button_test" name="Test" value="MyInput">
<div onclick="enable()">Enable Button</div>
<div onclick="disable()">Disable Button</div>

JAVASCRIPT:

<script language='javascript'>
function enable() {
  $('button_test').enable();
}

function disable() {
  $('button_test').disable();
}
</script>

CHANGE enable TO:

enable: function(element) {
    element = $(element);
    element.disabled = '';
    return element;
  }

CHANGE disable TO:

disable: function(element) {
    element = $(element);
    element.blur();
    element.disabled = 'true';
    return element;
  }

Change History

09/06/06 16:40:55 changed by anonymous

  • status changed from new to closed.
  • resolution set to fixed.

09/06/06 19:39:38 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

This is NOT fixed. The enable and disable functions are switched.

09/06/06 20:24:56 changed by madrobby

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [5052]) Prototype: Form.Element.disable() and .enable() will now work correctly, fixes #6034 [dresselm@businesslogic.com]

03/05/07 15:12:15 changed by tdd

  • status changed from closed to reopened.
  • resolution deleted.

Actually, the blur() call is in enable(), instead of disable(), where it belongs. I don't think this warrants an extra patch file, do you Thomas? Can you just switch the line over?

03/05/07 15:12:47 changed by tdd

  • owner changed from sam to madrobby.
  • status changed from reopened to new.

03/05/07 16:03:26 changed by madrobby

Fixed in [6338].

03/05/07 16:03:40 changed by madrobby

  • status changed from new to closed.
  • resolution set to fixed.