-
Notifications
You must be signed in to change notification settings - Fork 0
/
workwithform
38 lines (35 loc) · 858 Bytes
/
workwithform
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
import webapp2
form="""
<form method = "post">
what is your birthday?
<br>
<label>
month
<input type = "text" name = "month">
</label>
<label>
day
<input type = "text" name = "day">
</label>
<label>
year
<input type = "text" name = "year">
</label>
<div style="color:red">Enter your valid DOB</div>
<br>
<br>
<input type="submit">
</form>
"""
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.out.write(form)
def post(self):
"""user_month = valid_month(self.request.get('month'))
user_day = valid_day(self.request.get('day'))
user_year = valid_year(self.request.get('year'))
if not (user_month and user_day and user_year):
self.response.out.write(form)
else:"""
self.response.out.write("Thanks!This is valid date")
app = webapp2.WSGIApplication([('/', MainPage)], debug=True)