/
config.xml
77 lines (68 loc) · 2.49 KB
/
config.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<config>
<formValidator>
<!-- This section contains english text that will be inserted into the page -->
<templates>
<hasError><![CDATA[
<div id="errorMessage">
<p>There are errors with the information you are trying
to submit. Please check the form below, correct the
errors and resubmit.</p>
</div>
]]></hasError>
<submissionAlert removeMultispaces="true">
If this was a real form, the information above would
have been submitted. Since this isn't, we won't submit
any of the form information, including the @ccType@ Credit Card number
@ccNum@.</submissionAlert>
</templates>
<errors>
<mandatoryField>
The above field is mandatory
</mandatoryField>
</errors>
<!-- This section describes validation information -->
<creditCardForm>
<inputs datatype="array">
<name>
<isMandatory>true</isMandatory>
</name>
<address>
<isMandatory>true</isMandatory>
</address>
<city>
<isMandatory>true</isMandatory>
</city>
<province>
<isMandatory>true</isMandatory>
</province>
<postalCode>
<isMandatory>true</isMandatory>
<!-- Note: We assume Canadian postal codes only -->
<pattern>^[a-zA-Z]\d[a-zA-Z]\s*\d[a-zA-Z]\d$</pattern>
<unmatchError>The postal code must be in a valid format.</unmatchError>
</postalCode>
<!-- Credit card information -->
<ccType>
<isMandatory>true</isMandatory>
</ccType>
<ccNum>
<isMandatory>true</isMandatory>
<!-- *******************************************************************
a much better pattern for credit cards is described at
http://www.regular-expressions.info/creditcard.html
I don't use it here because I don't want to encourage
people putting in their real credit cards in this
test. :-)
******************************************************************-->
<pattern>^\d{16}$</pattern>
<unmatchError>The credit card you entered is not valid.</unmatchError>
</ccNum>
<ccExp>
<isMandatory>true</isMandatory>
<pattern>^(0[1-9]|1[1-2])/\d{2}$</pattern>
<unmatchError>The expiry date must be in the form yy/mm.</unmatchError>
</ccExp>
</inputs>
</creditCardForm>
</formValidator>
</config>