Skip to content

Commit cb97ea6

Browse files
i have finished form controls
1 parent 358cc76 commit cb97ea6

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

Form-Controls/index.html

+35-7
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,44 @@
1212
<h1>Product Pick</h1>
1313
</header>
1414
<main>
15-
<form>
16-
<!-- write your html here-->
17-
<!--
18-
try writing out the requirements first as comments
19-
this will also help you fill in your PR message later-->
15+
<form action="results.html" method="get" enctype="multipart/form-data">
16+
<div>
17+
<label for="name">Name</label>
18+
<input type="text" name="name" id="name" required minlength="2">
19+
</div>
20+
</div>
21+
<div>
22+
<label for="email">Email</label>
23+
<input type="email" name="email" id="email" required>
24+
</div>
25+
<div>
26+
<label for="colour">Colour</label>
27+
<select type="colour" name="colour" id="colour" >
28+
<option value="Red">Red</option>
29+
<option value="Blue">Blue</option>
30+
<option value="Green">Green</option>
31+
</select>
32+
</div>
33+
<div>
34+
<label for="Size">Size</label>
35+
<select type="Size" name="Size" id="Size" >
36+
<option value="XSmall">XSmall</option>
37+
<option value="Small">Small</option>
38+
<option value="Medium">Medium</option>
39+
<option value="Large">Large</option>
40+
<option value="XLarge">XLarge</option>
41+
<option value="XXLarge">XXLarge</option>
42+
</select>
43+
</div>
44+
<div>
45+
<button type="Submit">Submit</button>
46+
<button type="Reset">Reset</button>
47+
</div>
2048
</form>
2149
</main>
2250
<footer>
2351
<!-- change to your name-->
24-
<h2>By HOMEWORK SOLUTION</h2>
52+
<h2>SOMAYEH IRANKHAH</h2>
2553
</footer>
2654
</body>
27-
</html>
55+
</html>

Form-Controls/results.html

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<title>My form exercise</title>
7+
<meta name="description" content="" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
<title>Results</title>
10+
</head>
11+
<body>
12+
<div>
13+
<div id="results">
14+
</div>
15+
<a href="C:/Users/User/CYF/Module-Onboarding/Module-Onboarding/Form-Controls/index.html">Back To Form</a>
16+
<script>
17+
const resultslist=document.getElementById('results')
18+
new URLSearchParams(window.location.search).forEach((value,name)=>
19+
{
20+
resultslist.append(`${name}:${value}`)
21+
resultslist.append(document.createElement(`br`))
22+
})
23+
</script>
24+
</div>
25+
</body>

0 commit comments

Comments
 (0)