-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.html
114 lines (109 loc) · 4.05 KB
/
forms.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forms Demo
</title>
</head>
<body>
<h1>Forms Demo</h1>
<form action="/tacos">
<p>
<label for="username"> Enter a Username:</label>
<input id="username" type="text" placeholder="username" name="username">
</p>
<p>
<label for="password">Enter a Password:</label>
<input type="password" placeholder="password" id="password" name="password">
</p>
<p>
<label for="color">Enter a color:</label>
<input type="color" id="color" name="color">
</p>
<p>
<label for="number">Enter a Number:</label>
<input type="number" placeholder="enter a number" id="number" name="number" min="1" max="1000" step="2">
</p>
<!--this button doesn't submit the form b/c of the "type" attribute-->
<button type="button">Regular button (won't submit)</button>
<!--This button submits the form-->
<button>Submit</button>
<!--So does this one-->
<input type="submit" value="Click Me!">
</form>
<hr>
<button>Not Inside Form</button>
<h2>Hijacking Searches</h2>
<h3>Search Reddit</h3>
<form action="https://www.reddit.com/search/">
<input type="text" name="q">
<button>Search Reddit</button> </form>
<h3>Search Google</h3>
<form action="https://www.google.com/search">
<input type="text" name="q">
<button>Search Google</button>
</form>
<h3>Search Youtube</h3>
<form action="https://www.youtube.com/results">
<input type="text" name="search_query">
<button>Search Youtube</button>
</form>
<h2>More Inputs!</h2>
<form action="/birds">
<input type="checkbox" name="agree_tos" id="agree">
<label for="agree">I agree to everything</label>
<p>
<label for="XS">XS:</label>
<input type="radio" name="size" id="XS" value="xs">
<label for="S">S:</label>
<input type="radio" name="size" id="S" value="s">
<label for="M">M:</label>
<input type="radio" name="size" id="M" value="m">
</p>
<p>
<label for="meal">Please Select an Entree</label>
<select name="meal" id="meal">
<option value="Fish">Fish</option>
<option value="Veg">Veg</option>
<option value="Chicken">Chicken</option>
<option value="Steak">Steak</option>
</select>
</p>
<p>
<label for="cheese">Amount of Cheese</label>
<input type="range" id="cheese" min="1" max="10" name="cheese_level">
</p>
<p>
<label for="requests">Any Special Request?</label>
<textarea name="requests" id="" cols="30" rows="10" placeholder="Type Something here"></textarea>
</p>
<button>Submit</button>
</form>
<!--Practice-->
<form action="Username">
<p>
<label for="Username">Username</label>
<input id="Username" type="text" placeholder="username" name="username">
<label for="Password">Password</label>
<input id="Password" type="password" placeholder="password" name="password">
<button type="button">Register</button>
</p>
</form>
<h2>Validations Demo</h2>
<form action="/dummy">
<label for="first">Enter First Name</label>
<input type="text" name="first" id="first" required>
<p>
<label for="username">Username</label>
<input type="text" id="username" name="username" minlength="5" maxlength="20" required>
</p>
<p>
<input type="email" required>
<!-- <input type="url" required> -->
</p>
<button>Submit</button>
</form>
</body>
</html>