I've been banging my head trying to figure this out (and yes reading
all the documentation).

What I want to do is:

1. Set an observer for multiple forms which enables a set of buttons
2.. When the "reset" button is clicked:
2a.Stop the current .Observer event associated with the current form
2b. .reset() the form to it's original state
2c. Hide the submit and reset buttons
2d. re-invoke the observer for the form.

Here is what I have:

Step 1: Set the observer for all the page forms [this works fine -
forms are named frma, frmb, ...]

document.observe('dom:loaded',function(){
        $$('form').each(function(e) {
                new Form.Observer(e, 0.3, function(form){
                        var buttons = e.getInputs('button');
                        buttons.invoke('show');
                });
        });
});

Step 2: This is where my code has a hicup, I need assistance
using .stopObserving.  What am I missing?

<input type="button" class="button" value="Cancel" id="btncancela"
name="btncancela" onClick="LocalCancel('a');">

function LocalCancel(tab){
        Event.stopObserving('frm'+tab); // <- throws error
        $('btncreate'+tab).hide();$('btncancel'+tab).hide();
        $('frm'+tab).reset();
        //How to reset observer for this form here?
};

-- 
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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to