-
Notifications
You must be signed in to change notification settings - Fork 0
/
Forms and inputs.html
146 lines (118 loc) · 4.53 KB
/
Forms and inputs.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
<!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 and Input tags</title>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro&display=swap" rel="stylesheet" />
<style>
body {
font-family: "Source Sans Pro", sans-serif;
}
.container {
border: 2px solid paleturquoise;
}
.forms div {
/* border: 2px solid palegreen; */
margin: 20px;
padding: 10px;
}
</style>
</head>
<body>
<!--
The different input types are as follows:
<input type="button">
<input type="checkbox">
<input type="color">
<input type="date">
<input type="datetime-local">
<input type="email">
<input type="file">
<input type="hidden">
<input type="image">
<input type="month">
<input type="number">
<input type="password">
<input type="radio">
<input type="range">
<input type="reset">
<input type="search">
<input type="submit">
<input type="tel">
<input type="text"> (default value)
<input type="time">
<input type="url">
<input type="week">
-->
<div class="container">
<h2>This is Form and Input</h2>
<form class="forms" action="file.php">
<div>
<label for="name">Name (Text): </label>
<!--
Proper use of labels with the elements above will benefit:
Screen reader users (will read out loud the label, when the user is focused on the element).
Users who have difficulty clicking on very small regions (such as checkboxes) - because when a user clicks the text within the <label> element, it toggles the input (this increases the hit area). -->
<input type="text" name="nametext" id="name" />
</div>
<div>
<label for="email">Email: </label>
<input type="email" name="myemail" id="email" />
</div>
<div>
<label for="color">Color: </label>
<input type="color" name="mycolor" id="color" />
</div>
<div>
<label for="date">Date: </label>
<input type="date" name="date" id="date" />
</div>
<div>
<label for="datetime">DateTime: </label>
<input type="datetime-local" name="" id="datetime" />
<!--Use (type="datetime-local" and not "datetime", for some reason it wasn't working)
Note: type="datetime-local" is not supported in Firefox, Safari or Internet Explorer 12 (or earlier). -->
</div>
<div>
<label for="number">Number: </label>
<input type="number" name="" id="number" placeholder="only 'e' and numerical values accepted " />
</div>
<div>
<label for="password">Password: </label>
<input type="password" name="" id="password" />
</div>
<div>
<label for="range">Range: </label>
<input type="range" name="" id="range" />
</div>
<div>
<label for="checkbox">Checkbox: </label>
<input type="checkbox" name="" id="checkbox" />
</div>
<div>
Radio: <br />
<label for="male">Male: </label>
<input type="radio" name="radio" id="male" />
<label for="female">Female: </label>
<input type="radio" name="radio" id="female" />
<!-- Notice that we have used (name='radio') for both Male and Female . This way the radio button checks and accepts only either of one value and not both at the same time.-->
</div>
<div>
<label for="textarea">Textarea: </label><br />
<textarea name="mytext" id="textarea" cols="50" rows="10" placeholder="Write about yourself"></textarea>
</div>
<div>
<input type="submit" value="Submit Now" />
<input type="reset" value="Reset Form" />
</div>
<div>
<label for="search">Search: </label>
<input type="search" name="Search" id="search" placeholder="search here"/>
</div>
</form>
</div>
</body>
</html>