[Seaside] Self-modifying forms

Lukas Renggli seaside@lists.squeakfoundation.org
Mon, 18 Nov 2002 09:15:15 +0100


> I've seen this before: you're filling in  a form and you choose your
> country from a drop down list.  Suddenly the form reloads and some
> options have changed based on the country.  When the user comes to the
> end of the form they submit it.

The trick is to submit the form using JavaScript. To do that just add the
following attribute to your component:

    onChange="submit()"

Make sure that your component is in a form on its own, so you don't mess up
with different controls and can change your applications state as needed.

To see something like that running, check out the component
WAPluggableSelectBox and the applications WABrowser and WADebugger.

--
Lukas Renggli
http://renggli.freezope.org