forked from usds/html-prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
155 lines (122 loc) · 3.38 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
layout: default
---
<h1>Sample form</h1>
<form class="usa-form">
<fieldset class="usa-fieldset margin-top-5">
<legend class="usa-legend">Inputs</legend>
{% include form-fields/_text-field.html
id="first_name"
label_text="First name"
hint="This is what people call you"
%}
{% include form-fields/_text-field.html
id="last_name"
label_text="Last name"
%}
{% include form-fields/_text-field.html
id="favorite_food"
label_text="Favorite food"
disabled="true"
input_value="burgers"
%}
</fieldset>
<fieldset class="usa-fieldset margin-top-5">
<legend class="usa-legend">Radios</legend>
{% include form-fields/_radio.html
name="radio_group"
id="radio_1"
label_text="Option without a follow up"
%}
{% include form-fields/_radio.html
name="radio_group"
id="radio_2"
label_text="Option with a followup"
follow_up="followup1"
follow_up_optional="true"
%}
<div class="usa-form-followup" id="followup1" hidden>
{% include form-fields/_text-field.html
id="specify"
label_text="Specify"
disabled="true"
optional="true"
%}
</div>
</fieldset>
<fieldset class="usa-fieldset margin-top-5">
<legend class="usa-legend">Checkbox</legend>
{% include form-fields/_checkbox.html
name="checkbox_group"
id="checkbox_1"
label_text="Checkbox without a follow up"
%}
{% include form-fields/_checkbox.html
name="checkbox_group"
id="checkbox_2"
label_text="Checkbox with a required followup"
follow_up="followup2"
follow_up_optional="true"
%}
<div class="usa-form-followup" id="followup2" hidden>
{% include form-fields/_text-field.html
id="specify2"
label_text="Specify"
disabled="true"
%}
</div>
</fieldset>
<fieldset class="usa-fieldset margin-top-5">
<legend class="usa-legend">Select boxes</legend>
{% include form-fields/_select.html
id="basic_select"
label_text="Basic select box"
options=" | Option 1 | Option 2"
%}
{% include form-fields/_select.html
id="title"
label_text="Select box with followup"
options=" | Mr. | Mrs. | Ms. | Dr. | Other (Please specify)"
optional="true"
follow_up="followup_select"
follow_up_optional="true"
follow_up_option="Other (Please specify)"
%}
<div class="usa-form-followup" id="followup_select" hidden>
{% include form-fields/_text-field.html
id="specify_select"
label_text="Specify"
disabled="true"
%}
</div>
{% include form-fields/_state-select.html
id="some_state"
%}
</fieldset>
<fieldset class="usa-fieldset margin-top-5">
<legend class="usa-legend">Text area</legend>
{% include form-fields/_text-area.html
id="textarea"
label_text="Write something"
hint="Anything"
optional="true"
%}
</fieldset>
<div class="margin-top-5">
<button type="submit" name="button" class="usa-button">Submit</button>
</div>
</form>
<script>
$(document).ready(function() {
$('form').on('submit', function() {
if (!checkValidityIfSupported($('form').get(0))) {
return false;
}
else {
updateStoredData();
nextPage("index2.html");
return false;
}
});
});
</script>