<h4 class="samplesGroup">Dynamic selection list update</h4>
<title>Country selector</title>
<para>This example illustrates how you can programmatically update the
content of a selection list using a collection built in the flow.</para>
<para>
This sample illustrates event-handling in Cocoon Forms and how selection lists can
be changed
programmatically.
</para>
<para>
Event-handlers are defined in the form definition to update the selection lists and
set
the comment text below the table. This requires only a few lines of server-side JavaScript.
Selection widgets also have a "submit-on-change" attribute set in the form template
so that
changes are considered immediately by the server.
</para>
<para>
See "countryselector_form.xml" and "countryselector_template.xml" to see how this
is done.
</para>
-<content>
-<ft:form-template action="countryselector" method="POST">
<ft:continuation-id/>
-<fi:group>
<fi:styling layout="columns"/>
-<fi:items>
<ft:widget id="us-nonus"/>
<ft:widget id="country"/>
<ft:widget id="message"/>
<input type="submit"/>
</fi:items>
</fi:group>
</ft:form-template>
</content>
-<para>
<a href="./">Back to Forms samples</a>
</para>
</page>