Skip to content

Commit 0527d28

Browse files
Add name field with required and pattern validation
1 parent d28242a commit 0527d28

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

Form-Controls/index.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,24 @@ <h1>Product Pick</h1>
1313
</header>
1414
<main>
1515
<form>
16-
<!-- write your html here-->
1716
<!--
18-
try writing out the requirements first as comments
19-
this will also help you fill in your PR message later-->
17+
Requirements:
18+
- Name: required, at least 2 non-space characters
19+
- Email: required, valid email format
20+
- Colour: required, choose 1 of 3 options
21+
- Size: required, choose 1 of 6 sizes
22+
- No form action needed for this project
23+
-->
24+
<div class="field">
25+
<label for="name">Name</label>
26+
<input type="text" id="name" name="name" pattern=".*\S.*\S.*" required>
27+
</div>
28+
<button type="submit">Submit</button>
2029
</form>
2130
</main>
2231
<footer>
2332
<!-- change to your name-->
24-
<p>By HOMEWORK SOLUTION</p>
33+
<p>By Lamla Kamana</p>
2534
</footer>
2635
</body>
2736
</html>

0 commit comments

Comments
 (0)