This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
140 lines (107 loc) · 3.14 KB
/
index.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Can | HTML 5 Validation poc</title>
<link rel="stylesheet" type="text/css" href="src/css/main.css" />
</head>
<body>
<!--form main template-->
<script type='text/stache' id='form-template'>
{{#eq page 'index'}}
<h1> Simple registration</h1>
<form onsubmit="return false;" autocomplete= "off" name="customerComplainForm">
<input:field
{label-text}='firstNameLabel'
{(input-value)}= '{firstName}'
{is-required}= 'isFirstNameRequired'
/>
<input:field
{label-text}='lastNameLabel'
{(input-value)}= '{lastName}'
{is-required}= 'isLastNameRequired'
/>
<input:field
{label-text}='emailLabel'
{(input-value)}= '{email}'
{input-type}= 'emailType'
{pattern}= 'emailPattern'
{is-required}= 'isLastNameRequired'
/>
<input:field
{label-text}='ageLabel'
{input-type}= 'ageType'
{(input-value)}= '{age}'
{min-value}= 'minmumAge'
{max-value}= 'maximumAge'
{is-required}= 'isAgeRequired'
/>
<h4>Sex group</h4>
<input:field
{label-text}='maleText'
{show-label}='maleShowLabel'
{input-type}= 'maleInputType'
{input-name}='sexGroupName'
{(input-value)}= '{male}'
{is-required}= 'isSexGroupRequired'
/>
<input:field
{label-text}='femaleText'
{show-label}='femaleShowLabel'
{input-type}= 'femaleInputType'
{input-name}='sexGroupName'
{(input-value)}= '{female}'
{is-required}= 'isSexGroupRequired'
/>
<p>
<button ($click) = 'submitForm()'>Submit</button>
</p>
</form>
{{else}}
<salutation:text {welcome-text}='{welcomeText}' />
A confirmation mail sent to {{email}}
<p>
Your age is: {{age}}
</p>
{{/eq}}
</script>
<!-- Input field component-->
<script type='text/stache' id='input-field'>
<p>
{{#unless showLabel}}
<label for="{{toCamelCase labelText}}">{{labelText}}</label>
{{/unless}}
<br />
<input
id='{{toCamelCase labelText}}'
{{#if inputType}}
type='{{inputType}}'
{{/if}}
{{#if inputName}}
name='{{inputName}}'
{{/if}}
{{#if pattern}}
pattern= '{{pattern}}'
{{/if}}
{{#if minValue}}
min='{{minValue}}'
{{/if}}
{{#if maxValue}}
max='{{maxValue}}'
{{/if}}
value='{{inputValue}}'
($input)='update($element.value)'
{{#if isRequired}}
required
{{/if}}
/>
{{#if showLabel}}
<label for="{{toCamelCase labelText}}">{{labelText}}</label>
{{/if}}
</p>
</script>
<script src="src/js/jquery-2.2.4.js"></script>
<script src="src/js/can-3.4.0.js"></script>
<script src="src/js/main.js"></script>
</body>
</html>