Skip to content

Commit 7e143ef

Browse files
committed
Feat: fixed the pattern to require two or more characters
1 parent 719da41 commit 7e143ef

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

Form-Controls/index.html

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>My form exercise</title>
77
<meta name="description" content="Product Pick form for selecting name, email, shirt color, and size.">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
9-
<link rel="stylesheet" href="main.css">
9+
<link rel="stylesheet" href="styles/main.css">
1010
<link rel="preconnect" href="https://fonts.googleapis.com">
1111
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1212
<link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap"
@@ -21,16 +21,6 @@ <h1>Product Pick</h1>
2121

2222

2323
<form>
24-
<!-- write your HTML here-->
25-
<!--
26-
try writing out the requirements first as comments
27-
this will also help you fill in your PR message later-->
28-
29-
<!-- first and lastname (ensure it contains at least two non-space characters.)-->
30-
<!-- email (make sure the email is valid. Email addresses follow a consistent pattern.)-->
31-
<!-- shirt color (I must provide 3 options. How will I ensure they do not choose other colors?)-->
32-
<!-- shirt size (must provide the following 6 options: XS, S, M, L, XL, XXL)-->
33-
3424

3525
<div class="form-group">
3626
<label for="firstname">First Name </label>
@@ -39,7 +29,7 @@ <h1>Product Pick</h1>
3929
id="firstname"
4030
name="firstname"
4131
required
42-
pattern="[\p{L}]+(?:['\-][\p{L}]+)*"
32+
pattern="[\p{L}]{2,}(?:['\-][\p{L}]+)*"
4333
title="enter a valid name">
4434
</div>
4535

@@ -50,7 +40,7 @@ <h1>Product Pick</h1>
5040
id="lastname"
5141
name="lastname"
5242
required
53-
pattern="[\p{L}]+(?:['\-][\p{L}]+)*"
43+
pattern="[\p{L}]{2,}(?:['\-][\p{L}]+)*"
5444
title="enter a valid name">
5545
</div>
5646

@@ -117,7 +107,6 @@ <h1>Product Pick</h1>
117107
</main>
118108

119109
<footer>
120-
<!-- change to your name-->
121110
<p>By DAMILOLA ODUMOSU</p>
122111
</footer>
123112
</body>

0 commit comments

Comments
 (0)