Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

Flow Fields

The filename is specified by a line in the JavaScript:
var form = new Form("flow/myFlowFunction/form.xml");
It assumes it is starting from the directory of the XMAP file, typically kept in {pub}.

XML Field Definitions


<?xml version="1.0"?>
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
<fd:widgets>

<fd:output id="messages">
<fd:label></fd:label>
<fd:datatype base="string"/>
</fd:output>

<fd:field id="name" required="true">
<fd:label><i18n:text>Name</i18n:text>:</fd:label>
<fd:datatype base="string">
<fd:validation>
<fd:length min="2"/>
</fd:validation>
</fd:datatype>
</fd:field>

<fd:field id="email" required="true">
<fd:label><i18n:text>Email address</i18n:text>:</fd:label>
<fd:datatype base="string">
<fd:validation>
<fd:email/>
</fd:validation>
</fd:datatype>
</fd:field>

<fd:field id="password" required="true">
<fd:label><i18n:text>Password</i18n:text>:</fd:label>
<fd:datatype base="string">
<fd:validation>
<fd:length min="5" max="20"/>
</fd:validation>
</fd:datatype>
</fd:field>

<fd:field id="confirmPassword" required="true">
<fd:label><i18n:text>Re-enter password</i18n:text>:</fd:label>
<fd:datatype base="string">
<fd:validation>
<fd:assert test="password = confirmPassword">
<fd:failmessage><i18n:text>The two passwords are not equal.</i18n:text></fd:failmessage>
</fd:assert>
</fd:validation>
</fd:datatype>
</fd:field>

<fd:field id="selectionField1" required="true">
<fd:label><i18n:text>Select one</i18n:text>:</fd:label>
<fd:datatype base="string"/>
<fd:selection-list>
<fd:item value="1"><fd:label>Monday</fd:label></fd:item>
<fd:item value="2"><fd:label>Tuesday</fd:label></fd:item>
<fd:item value="3"><fd:label>Wednesday</fd:label></fd:item>
<fd:item value="4"><fd:label>Thursday</fd:label></fd:item>
<fd:item value="5"><fd:label>Friday</fd:label></fd:item>
</fd:selection-list>
</fd:field>

<fd:field id="selectionField2" required="true">
<fd:label><i18n:text>Select one</i18n:text>:</fd:label>
<fd:datatype base="boolean"/>
<fd:selection-list>
<fd:item value="1"><fd:label>Monday</fd:label></fd:item>
<fd:item value="2"><fd:label>Tuesday</fd:label></fd:item>
<fd:item value="3"><fd:label>Wednesday</fd:label></fd:item>
<fd:item value="4"><fd:label>Thursday</fd:label></fd:item>
<fd:item value="5"><fd:label>Friday</fd:label></fd:item>
</fd:selection-list>
</fd:field>

<fd:multivaluefield id="dynamicSelectionField">
<fd:label><i18n:text>Choose several</i18n:text>:</fd:label>
<fd:datatype base="boolean"/>
</fd:multivaluefield>

</fd:widgets>
</fd:form>

Explanation


Messages is the standard method of passing messages from JavaScript to the webpage.
Name is a text field, requiring a minimum of 2 characters.
Email is a text field, requiring it pass the standard email validation.
Password is a text field that must have 5 to 20 characters.
confirmPassword is a text field, with validation that it matches the "password" field.
selectionField1 is a single-choice dropdown list.
selectionField2 is boolean. Boolean fields default to radio buttons unless overriden in the presentation.
dynamicSelectionField is boolean with the choices set in JavaScript.

As always, use i18n for all visible text, and make certain to add the phrases to the cmsui_xx.xml files.

<< LanguagePresentation >>

Contact Solprovider
Paul Ercolino