| <?xml version="1.0"?> |
| |
| <!--+ |
| | CVS $Id: form1.xml,v 1.3 2004/02/29 06:18:29 vgritsenko Exp $ |
| +--> |
| |
| <wd:form xmlns:wd="http://apache.org/cocoon/woody/definition/1.0"> |
| |
| <wd:widgets> |
| <wd:field id="tab-state"> |
| <wd:datatype base="string"/> |
| </wd:field> |
| |
| <wd:field id="email" required="true"> |
| <wd:datatype base="string"> |
| <wd:validation> |
| <wd:email/> |
| </wd:validation> |
| </wd:datatype> |
| <wd:label>Enter an <b>email</b> address:</wd:label> |
| <wd:help> |
| An email address must be in <i>[name]@[domain].[tld]</i> format. |
| <br/> |
| And if you do not know what <b>email</b> address is, then well, chances are |
| that you do not have it. However, if you have access to the Internet, |
| you can easily get yourself one! |
| <br/> |
| Choose one of the following options: |
| <ul> |
| <li><a href='http://mail.yahoo.com/'>Yahoo! Mail</a></li> |
| <li><a href='http://www.hotmail.com/'>Hotmail</a></li> |
| </ul> |
| <small>Anyway, the point of all this was to show a popup help with mixed html content.</small> |
| </wd:help> |
| </wd:field> |
| |
| <wd:booleanfield id="somebool"> |
| <wd:label>Put me <em>on</em> or <em>off</em>.</wd:label> |
| </wd:booleanfield> |
| |
| <wd:field id="fourchars"> |
| <wd:label>Select something that's 4 characters long:</wd:label> |
| <wd:datatype base="string"> |
| <wd:validation> |
| <wd:length exact='2*2'/> |
| </wd:validation> |
| </wd:datatype> |
| <wd:selection-list src="a-choices.xml"/> |
| </wd:field> |
| |
| <wd:field id="account"> |
| <wd:label>Indicate the size of your bank account (in m<sup>3</sup>):</wd:label> |
| <wd:datatype base="long"/> |
| <wd:selection-list> |
| <wd:item value="1"/> |
| <wd:item value="2"/> |
| <wd:item value="3"> |
| <wd:label>three</wd:label> |
| </wd:item> |
| <wd:item value="4"/> |
| <wd:item value="5"/> |
| </wd:selection-list> |
| </wd:field> |
| |
| <wd:field id="cowheight"> |
| <wd:label>Indicate your height (in cows):</wd:label> |
| <wd:datatype base="long"/> |
| <wd:selection-list> |
| <wd:item value="1"/> |
| <wd:item value="2"/> |
| <wd:item value="3"> |
| <wd:label>three</wd:label> |
| </wd:item> |
| <wd:item value="4"/> |
| <wd:item value="5"/> |
| </wd:selection-list> |
| </wd:field> |
| |
| <wd:field id="number1" required="true"> |
| <wd:label>Please enter a number<br/> |
| <small>(will automatically set a correct value below if needed)</small>:</wd:label> |
| <wd:datatype base="long"/> |
| </wd:field> |
| |
| <wd:field id="number2" required="true"> |
| <wd:label>Enter another number, larger than the other number:</wd:label> |
| <wd:datatype base="long"> |
| <wd:validation> |
| <wd:range min="number1 + 1"> |
| <wd:failmessage>This number should be larger than the first number.</wd:failmessage> |
| </wd:range> |
| </wd:validation> |
| </wd:datatype> |
| </wd:field> |
| |
| <wd:multivaluefield id="drinks"> |
| <wd:label>Indicate which 2 of the following drinks you'd like to receive:</wd:label> |
| <wd:datatype base="string"> |
| <wd:validation> |
| <wd:value-count exact="2"/> |
| </wd:validation> |
| </wd:datatype> |
| <wd:selection-list> |
| <wd:item value="Maes"/> |
| <wd:item value="Jupiler"/> |
| <wd:item value="Leffe"/> |
| <wd:item value="Hoegaarden"/> |
| <wd:item value="Coca Cola"/> |
| </wd:selection-list> |
| </wd:multivaluefield> |
| |
| <wd:aggregatefield id="visa" required="true"> |
| <wd:label>Enter your (16-digit) visa number (without spaces) |
| <br/>Your credit card will be billed. |
| <br/><small>Valid test number is: 4111111111111111</small> |
| </wd:label> |
| <wd:help>Use a fake number if <a href="http://cocoon.apache.org">Cocoon</a> is not running on your local computer</wd:help> |
| <wd:datatype base="string"/> |
| <wd:split pattern="([0-9]{4})([0-9]{4})([0-9]{4})([0-9]{4})"> |
| <wd:map group="1" field="part1"/> |
| <wd:map group="2" field="part2"/> |
| <wd:map group="3" field="part3"/> |
| <wd:map group="4" field="part4"/> |
| <wd:failmessage>Not a valid 16-digit visa number.</wd:failmessage> |
| </wd:split> |
| <wd:combine expression='Concat(part1,part2,part3,part4)'/> |
| <wd:widgets> |
| <wd:field id="part1"> |
| <wd:datatype base="string"/> |
| </wd:field> |
| <wd:field id="part2"> |
| <wd:datatype base="string"/> |
| </wd:field> |
| <wd:field id="part3"> |
| <wd:datatype base="string"/> |
| </wd:field> |
| <wd:field id="part4"> |
| <wd:datatype base="string"/> |
| </wd:field> |
| </wd:widgets> |
| <wd:validation> |
| <wd:mod10> |
| <wd:failmessage>Invalid credit card number.</wd:failmessage> |
| </wd:mod10> |
| </wd:validation> |
| </wd:aggregatefield> |
| |
| <wd:field id="ipaddress" required="true"> |
| <wd:label>Please enter your IP address</wd:label> |
| <wd:datatype base="string"> |
| <wd:validation> |
| <wd:regexp pattern="^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$"> |
| <wd:failmessage>Invalid IP address.</wd:failmessage> |
| </wd:regexp> |
| </wd:validation> |
| </wd:datatype> |
| </wd:field> |
| |
| <wd:field id="birthdate" required="true"> |
| <wd:label>Your birthdate (dd/MM/yyyy):</wd:label> |
| <wd:datatype base="date"> |
| <wd:convertor> |
| <wd:patterns> |
| <wd:pattern>dd/MM/yyyy</wd:pattern> |
| <!-- The above pattern is a non-locale-specific pattern. You can |
| also add locale-specific patterns by adding more wd:pattern elements |
| here, with a locale attribute on them. --> |
| </wd:patterns> |
| </wd:convertor> |
| <wd:validation> |
| <wd:range min="Date(1850, 1, 1)" max="Date(2150, 1, 1)"> |
| <wd:failmessage>Dead and not born yet should not bother filling this form</wd:failmessage> |
| </wd:range> |
| </wd:validation> |
| </wd:datatype> |
| </wd:field> |
| |
| <wd:field id="altbirthdate" required="true"> |
| <wd:label>Select a date on which you'd rather had been born:</wd:label> |
| <wd:datatype base="date"> |
| <wd:convertor variant="date" style="full"/> |
| </wd:datatype> |
| <wd:selection-list> |
| <!-- The convertor element here is used to specify how the values |
| in the value attributes of the wd:item elements should be |
| interpreted. --> |
| <wd:convertor type="formatting"> |
| <wd:patterns> |
| <wd:pattern>yyyyMMdd</wd:pattern> |
| </wd:patterns> |
| </wd:convertor> |
| <wd:item value="13020711"/> |
| <wd:item value="19120623"/> |
| <wd:item value="19690721"/> |
| <wd:item value="19700506"/> |
| <wd:item value="19781014"/> |
| <wd:item value="20010911"/> |
| </wd:selection-list> |
| </wd:field> |
| |
| <wd:field id="dieselprice" required="true"> |
| <wd:label>Price for a liter diesel:</wd:label> |
| <wd:datatype base="decimal"> |
| <wd:convertor variant="number"> |
| <wd:patterns> |
| <wd:pattern>#.00</wd:pattern> |
| </wd:patterns> |
| </wd:convertor> |
| </wd:datatype> |
| </wd:field> |
| |
| <wd:repeater id="contacts"> |
| <wd:widgets> |
| <wd:field id="firstname"> |
| <wd:label>Firstname</wd:label> |
| <wd:datatype base="string"/> |
| </wd:field> |
| <wd:field id="lastname"> |
| <wd:label>Lastname</wd:label> |
| <wd:datatype base="string"/> |
| </wd:field> |
| <wd:field id="phone"> |
| <wd:label>Phone</wd:label> |
| <wd:datatype base="string"/> |
| </wd:field> |
| <wd:field id="email"> |
| <wd:label>Email</wd:label> |
| <wd:datatype base="string"> |
| <wd:validation> |
| <wd:email/> |
| </wd:validation> |
| </wd:datatype> |
| </wd:field> |
| <wd:booleanfield id="select"> |
| <wd:label>Select</wd:label> |
| </wd:booleanfield> |
| </wd:widgets> |
| </wd:repeater> |
| |
| <!--wd:repeater-action id="addcontact" action-command="add-row" repeater="contacts"> |
| <wd:label>Add contact</wd:label> |
| </wd:repeater-action> |
| |
| <wd:repeater-action id="removecontacts" action-command="delete-rows" repeater="contacts" select="select"> |
| <wd:label>Remove selected contacts</wd:label> |
| </wd:repeater-action--> |
| |
| <wd:action id="addcontact" action-command="x"> |
| <wd:label>Add contact</wd:label> |
| </wd:action> |
| |
| <wd:action id="removecontacts" action-command="x"> |
| <wd:label>Remove selected contacts</wd:label> |
| </wd:action> |
| </wd:widgets> |
| |
| </wd:form> |