Hello,

I have two buttons <button onclick="foo()" class="save"
id="random_number"> and want to add an observer and fire an own
function (bar()). When this function is completed, foo() shall get
called.
I tried it with the event.stop, but that just doesn't work.

var requestDone = false;
function bar() {
  // ....
  requestDone = true;
}
// Wait till page is fully loaded
Event.observe(window, 'load', function() {
        saveButtons = $$('button.save');
        // Observe the Save buttons and fire the getCategories() function on
click
        saveButtons.invoke('observe', 'click', function(event) {
                  if (false == requestDone) {
                            Event.stop(event);
                          }
                        });
        saveButtons.invoke('observe', 'click', bar());
});

Could anyone please point me in the right direction?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to