[Seaside] jQuery Serialization

Lukas Renggli renggli at gmail.com
Sun Jul 12 07:45:02 UTC 2009


> The problem I am having is doing radio buttons, check boxes, etc. for form
> serialization/validation. I'm not sure how: "find:':input'" works. Does it
> just go through and pick every input item on the page and serialize it?

Have a look at some of the JQuery documentation and tutorials at:

    http://docs.jquery.com/Main_Page
    http://docs.jquery.com/Tutorials

For example:

#find: searches for descendent elements that match the specified expression:

    http://docs.jquery.com/Traversing/find#expr

':input' matches all input, textarea, select and button elements:

     http://docs.jquery.com/Selectors/input

>     onClick: (html jQuery ajax script: [:script |
>         script add: (script jQuery: (self clickFunctionNext: html))
>     ]
>     );

To serialize all form elements on the complete page whenever this
onClick handler is triggered you could write the following:

onClick: (html jQuery ajax
    serialize: (html jQuery: ':input');
    script: [:script | script add: (script jQuery: (self
clickFunctionNext: html)) ])

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside mailing list