#27 enhancement
defel

let TimedObserver check if Form or Element is disabled

Reported by defel | April 18th, 2008 @ 02:28 PM | in 1.6.1

If I use the Form.Observer or the Form.Element.Observer and I make them disabled, and enable them later, the TimedObserver will overwrite the last value with an empty value, while the Form/Field is disabled.

This is because, if Form-Fields are disabled they don't return any values and I can't edit them, too. So it make no sense to save this (empty) state as the last value in the TimedObserver.

I have changed the Observer to return the last Value if the Element is disabled.

I have tested this patch under linux with FF 2.0.0.11 and Konqueror 3.5.8

Comments and changes to this ticket

  • defel

    defel April 18th, 2008 @ 02:56 PM

    ps.: With this, you can use the following code:

    Form.Observer('my_form', 0.5, function(form, values) {
      form.disable(); 
    			
      new Ajax.Request('/backendAjax.php', {
        method: 'POST', 
        postBody: 'some Post body .. ', 
        onComplete: function(t) {
          // make some foo and enable form again;
          form.enable();  
        }
      }); 
    }
    

    If the Form-Values changed, the form gets disabled, a Ajax.Request is sent (which may took more 0.5 seconds) and the form gets enabled when all things to do are done.

  • Tobie Langel

    Tobie Langel April 18th, 2008 @ 03:10 PM

    • → State changed from “new” to “enhancement”
  • John-David Dalton

    John-David Dalton May 29th, 2008 @ 04:25 AM

    • → Milestone changed from “” to “1.6.1”
  • John-David Dalton

    John-David Dalton May 29th, 2008 @ 04:26 AM

    • → Assigned user changed from “” to “John-David Dalton”

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Attachments