-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ITP London Jan 2025| Samunta Sunuwar |Module Onboarding | Form Controls|WEEK 2 #218
base: main
Are you sure you want to change the base?
Changes from 13 commits
a0ef3e8
352521e
34509ec
60349e7
37281ae
0fd7297
3a78e20
8674cf0
f0acc9e
d741ae9
98f6867
cc635ec
52175e3
052afb8
93aeef9
f72b481
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,16 +12,64 @@ | |
<h1>Product Pick</h1> | ||
</header> | ||
<main> | ||
<p> | ||
<strong>Required fields are followed by</strong> | ||
<strong><span aria-label="required">*</span></strong>. | ||
</p> | ||
<form> | ||
<!-- write your html here--> | ||
<!-- | ||
try writing out the requirements first as comments | ||
this will also help you fill in your PR message later--> | ||
</form> | ||
<!-- 1. What is the customer's name? I must collect this data, and validate it. But what is a valid name? I must decide something. | ||
2. What is the customer's email? I must make sure the email is valid. Email addresses have a consistent pattern. | ||
3. What colour should this t-shirt be? I must give 3 options. How will I make sure they don't pick other colours? | ||
4. What size does the customer want? I must give the following 6 options: XS, S, M, L, XL, XXL --> | ||
<section id="customer"> | ||
<fieldset> | ||
<legend>Customer Details</legend> | ||
<p> | ||
<label for="name">Name:<strong><a aria-label="required">*</a></strong> | ||
<input type="text" id="name" name="name" placeholder="Full Name" minlength="3" required> | ||
</p> | ||
<p> | ||
<label for="email">Email:<strong><a aria-label="required">*</a></strong> | ||
<input type="email" id="email" name="email" placeholder="Email Address" required> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You also need to inform the user that their input is incorrect. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your advice, I have added the title attribute now. Please could you review. |
||
</p> | ||
</fieldset> | ||
</section> | ||
<section id="order"> | ||
<fieldset> | ||
<legend>Order Details</legend> | ||
<p> | ||
<label for="color">Please pick a color for the T-shirt:</label> | ||
<select id="color" name="color"> | ||
<option value="Black">Black</option> | ||
<option value="Gray">Gray</option> | ||
<option value="White">White</option> | ||
</select> | ||
</p> | ||
<p> | ||
<label for="size">Please pick a size for the T-shirt:</label> | ||
<select id="size" name="size"> | ||
<option value="XS">Extra Small</option> | ||
<option value="S">Small</option> | ||
<option value="M">Medium</option> | ||
<option value="L">Large</option> | ||
<option value="XL">Extra Large</option> | ||
<option value="XXL">2XL</option> | ||
</select> | ||
</p> | ||
<p> | ||
<label for="number">Please input quantity you would like to order:<strong><a aria-label="required">*</a></strong></label> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quantity is not on the brief. Please remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Waldo, thank you for your feedback, I have removed this |
||
<input type="number" id="number" name="number" min="1" max="10" required> | ||
</p> | ||
</fieldset> | ||
</section> | ||
</form> | ||
<section id="buttons"> | ||
<button>Submit</button> | ||
</section> | ||
</main> | ||
<footer> | ||
<!-- change to your name--> | ||
<h2>By HOMEWORK SOLUTION</h2> | ||
<h2>By Samunta Sunuwar - Jan 2025 Cohort</h2> | ||
</footer> | ||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to require at least 2 characters for the name field.
You also need to inform the user that their input is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Waldo-Strydom Hi, thank you for the feedback. I have set the minlength to 2.
Please could you elaborate your second feedback "You also need to inform the user that their input is incorrect." I believe I have used correct validation for the form type="text" for Name and type="email" for email address. I am not sure how I can inform user their input is incorrect apart from using validation with HTML. Can you please point me in the direction of how I can achieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an example it should look like this.
You can give each field a title, to communicate with users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your advice, I have added the title attribute now. Please could you review.