-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.html
More file actions
93 lines (87 loc) · 4.48 KB
/
form.html
File metadata and controls
93 lines (87 loc) · 4.48 KB
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
<!--
=========================================================
Name : form.html
Assignment : Lab 3 Exercise C
Author(s) : Mahdi Ansari, William Arthur Philip Louis
Submission : May 21, 2030
Description : A simple HTML file for form tag.
=========================================================
-->
<!DOCTYPE html>
<html>
<head>
<title>Form Elements Demonstration</title>
</head>
<body>
<h1>HTML Form Elements Demo</h1>
<form action="#" method="post">
<fieldset>
<legend>Personal Information</legend>
<!-- Add a label and input field for 'Name' here -->
<label for="name">Name:</label><br>
<input type="name" id="name" name="name"><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email"><br>
<!-- Add a label and input field for 'Password' here, ensure to use the correct type for password fields -->
<label for="password">Password:</label><br>
<input type="password" id="password" name="password"><br>
</fieldset>
<fieldset>
<legend>Choice Elements</legend>
<p>Gender:</p>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label><br>
<!-- Create radio buttons for 'Female', and 'Other' gender options -->
<input type="radio" id="Female" name="gender" value="Female">
<label for="Female">Female</label><br>
<input type="radio" id="Other" name="gender" value="Other">
<label for="Other">Other</label><br>
<label for="fruits">Choose a fruit:</label><br>
<select id="fruits" name="fruits" size = "3">
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="orange">Orange</option>
<option value="cherry">Cherry</option>
<option value="blueberry">Blueberry</option>
<option value="mango">Mango</option>
<option value="peach">Peach</option>
<option value="grape">Grape</option>
<option value="strawberries">Strawberries</option>
<option value="kiwi">Kiwi</option>
<!-- Add options for various fruits like Banana, Orange, etc. (At least 10 fruits) -->
</select><br>
<!-- Add some attributes to select tag that changes it from a drop menu to a scrollable list.-->
</fieldset>
<fieldset>
<legend>Other Elements</legend>
<!-- Add a label and input field for 'Birthday' here, use the appropriate type for date selection -->
<label for="birthday">Birthday:</label><br>
<input type="date" id="birthday" name="birthday"><br>
<label for="favcolor">Favorite Color:</label><br>
<input type="color" id="favcolor" name="favcolor"><br>
<!-- Add a label and number input field for 'Quantity', set min to 1 and max to 5 -->
<label for="qauntity">Quantity(1~5):</label><br>
<input type="range" id="qauntity" name="qauntity" min="1" max="5" value="2"><br>
<label for="range">Range (between 1 and 10):</label><br>
<input type="range" id="range" name="range" min="1" max="10" value="2"><br>
<!-- Add an attribute to the range input to set its initial value to 2-->
<!-- Add a label and input field for 'Homepage', use the correct type for URLs -->
<label for="homepage">Homepage:</label><br>
<input type="url" id="homepage" name="homepage" value="https://"><br>
<label for="feedback">Feedback:</label><br>
<textarea id="feedback" name="feedback" rows = "5" cols = "80"></textarea><br>
<!-- Add some attributes to the feedback textarea tag to make it bigger and suitable for editing texts-->
<!-- Add a file input field -->
<label for="file">Upload a file:</label><br>
<input type="file" id="file" name="file"><br>
<!-- Add a checkbox for 'Subscribe to newsletter' -->
<input type="checkbox" id="subscribe" name="subscribe" value="subscribe">
<label for="subscribe">Subscribe to newsletter</label><br>
<!-- Add a hidden field for 'customerId', set its value to '12345' -->
<input type="hidden" id="customerId" name="customerId" value="12345">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</fieldset>
</form>
</body>
</html>