File tree 3 files changed +37
-0
lines changed
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,13 @@ def view_cookies(hide_env=True):
291
291
return jsonify (cookies = cookies )
292
292
293
293
294
+ @app .route ('/forms/post' )
295
+ def view_forms_post ():
296
+ """Simple HTML form."""
297
+
298
+ return render_template ('forms-post.html' )
299
+
300
+
294
301
@app .route ('/cookies/set/<name>/<value>' )
295
302
def set_cookie (name , value ):
296
303
"""Sets a cookie and redirects to cookie list."""
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ </ head >
5
+ < body >
6
+ <!-- Example form from HTML5 spec http://www.w3.org/TR/html5/forms.html#writing-a-form's-user-interface -->
7
+ < form method ="post " action ="/post ">
8
+ < p > < label > Customer name: < input name ="custname "> </ label > </ p >
9
+ < p > < label > Telephone: < input type =tel name ="custtel "> </ label > </ p >
10
+ < p > < label > E-mail address: < input type =email name ="custemail "> </ label > </ p >
11
+ < fieldset >
12
+ < legend > Pizza Size </ legend >
13
+ < p > < label > < input type =radio name =size value ="small "> Small </ label > </ p >
14
+ < p > < label > < input type =radio name =size value ="medium "> Medium </ label > </ p >
15
+ < p > < label > < input type =radio name =size value ="large "> Large </ label > </ p >
16
+ </ fieldset >
17
+ < fieldset >
18
+ < legend > Pizza Toppings </ legend >
19
+ < p > < label > < input type =checkbox name ="topping " value ="bacon "> Bacon </ label > </ p >
20
+ < p > < label > < input type =checkbox name ="topping " value ="cheese "> Extra Cheese </ label > </ p >
21
+ < p > < label > < input type =checkbox name ="topping " value ="onion "> Onion </ label > </ p >
22
+ < p > < label > < input type =checkbox name ="topping " value ="mushroom "> Mushroom </ label > </ p >
23
+ </ fieldset >
24
+ < p > < label > Preferred delivery time: < input type =time min ="11:00 " max ="21:00 " step ="900 " name ="delivery "> </ label > </ p >
25
+ < p > < label > Delivery instructions: < textarea name ="comments "> </ textarea > </ label > </ p >
26
+ < p > < button > Submit order</ button > </ p >
27
+ </ form >
28
+ </ body >
29
+ </ html >
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ <h2 id="ENDPOINTS">ENDPOINTS</h2>
36
36
< li > < a href ="/robots.txt " data-bare-link ="true "> < code > /robots.txt</ code > </ a > Returns some robots.txt rules.</ li >
37
37
< li > < a href ="/deny " data-bare-link ="true "> < code > /deny</ code > </ a > Denied by robots.txt file.</ li >
38
38
< li > < a href ="/cache " data-bare-link ="true "> < code > /cache</ code > </ a > 200 unless If-Modified-Since was sent, then 304.</ li >
39
+ < li > < a href ="/forms/post " data-bare-link ="true "> < code > /forms/post</ code > </ a > HTML form that submits to < code > /post</ code > .</ li >
39
40
</ ul >
40
41
41
42
You can’t perform that action at this time.
0 commit comments