/
dietary_allergies.html
210 lines (174 loc) · 5.32 KB
/
dietary_allergies.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html>
<head>
<title>Dietary Restrictions and Allergies Page</title>
<!-- import the webpage's stylesheet -->
<link rel="stylesheet" href="/dietary_allergies.css" />
<!-- import the webpage's javascript file -->
<!--<script src="/dietary_allergies.js" defer></script>-->
</head>
<!-- nutrition info from http://universityevents.harvard.edu/sites/universityevents.harvard.edu/files/FOOD%20RESTRICTIONS%20AND%20ALLERGIES.pdf -->
<h class="header">Dietary Restrictions</h>
<div class="topnav">
<a href="homepage.html">Home</a>
<a href="newrec.html">Recommendations</a>
<a href="history.html">My History</a>
<a href="favorites.html">Favorites</a>
<a class="active" href="diet_info.html">Dietary Information</a>
</div>
<script src="dietary_allergies.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Dietary restriction checkboxes -->
<label class="container" value="vegan" id="vegan">
Vegan
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="ovo" id="ovo">
Ovo-Vegetarian
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="lacto" id="lacto">
Lacto-Vegetarian
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="lactoovo" id="lactoovo">
Lacto-Ovo Vegetarians
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="pescetarian" id="pescetarian">
Pescetarian
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="none" id="none">
None
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<!-- Food allergy checkboxes -->
<h class="header">Allergies</h>
<label class="container" value="peanut" id="peanut">
Peanut
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="milk" id="milk">
Milk
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="egg" id="egg">
Egg
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="wheat" id="wheat">
Wheat
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="soy" id="soy">
Soy
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="fish" id="fish">
Fish
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="shellfish" id="shellfish">
Shellfish
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="none" id="none2">
None
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<!-- Religious restriction checkboxes -->
<h class="header">Religious Restrictions</h>
<label class="container" value="christian" id="christian">
Christian
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="judaism" id="judaism">
Judaism/Kosher
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="muslim" id="muslim">
Muslim
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="hindu" id="hindu">
Hindu
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="buddhist" id="buddhist">
Buddhist
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="none" id="none3">
None
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<!-- Health condition checkboxes -->
<h class="header">Health Conditions</h>
<label class="container" value="diabetes" id="diabetes">
Diabetes
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="glutenfree" id="glutenfree">
Gluten Free/Celiac
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="lactose" id="lactose">
Lactose Intolerant
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<label class="container" value="none" id="none4">
None
<input type="checkbox" />
<span class="checkmark"></span>
</label>
<h4
type="button"
id="continue"
onclick="window.location.href='homepage.html'"
>
Continue
</h4>
<script>
function onSubmit() {
var dietary_restrictions = document.getElementsByClass("container");
alert(dietary_restrictions.length());
var user_restrictions = {};
var count = 0;
for (var i = 0; i < dietary_restrictions.length(); i++) {
if (dietary_restrictions[i].isSelected()) {
user_restrictions[count] = dietary_restrictions[i];
count++;
}
}
var str = "";
for (var i2 = 0; i2 < user_restrictions.length(); i++) {
str += user_restrictions[i2];
}
alert(str);
}
</script>
</html>