Is it possible to use Form.Observer on a form that has one or more additional elements added to it after page load? I have a large page that I am trying to refactor. Currently, there is a separate form for each element in a Sortable UL. Each form has its own observer for changes, so the page remains live at all times and stays in synch with the db. This works up to a point, but it falls down and dies horribly when there are hundreds of forms on the page. I'd like to change this so that there is one parent form, with all of the elements in it, but still be able to add and remove groups of elements from the parent form. Imagine this sort of construction:

form (with an observer)
        fieldset id="element_1"
                input
                input
                input
        fieldset id="element_2"
                input
                input
                input
        fieldset id="element_3"
                input
                input
                input
        ...

        fieldset id="element_900"
                input
                input
                input

Now imagine that I need to be able to insert new fieldsets within the form after load, using Element.insert, or remove a fieldset using Element.remove. According to my naive read of the Form.Observer, it scans the form for form elements at initiation, and then polls those elements for changes on a schedule. Would I need to tear down and re- build this observer after each such modification?

Thanks in advance,

Walter

--
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-scriptaculous@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