Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,58 @@ <h1>Product Pick</h1>
<main>
<form>
<!-- write your html here-->
<div>
<legend>Customer details</legend>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<legend> is only valid inside one particular element, and it isn't <div>. Which element groups a set of fields and takes a legend? The MDN page from the prep on structuring a form shows it.

<label for="firstname">First name:</label>
<input type="text" id="firstname" name="firstname" required .*\S.*\S.*> <br>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex from the README is sitting here as an attribute on its own, so the browser ignores it. Which attribute is it meant to be the value of? I typed two spaces into this field on the deploy preview and it passed. Also the task asks for one name field, not first and last.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One name field now, good. The regex is still a bare attribute though, so this one is still open. See the new comment on line 23.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now, and two spaces are rejected. Good.

<label for="lastname">Last name:</label>
<input type="text" id="lastname" name="lastname" required>
<button type="Submit">Submit</button>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are four Submit buttons in this form, and one of them is inside the <select>. A form needs one. Where should it go?

</div>

<div>
<label for="email"> Email:</label>
<input type="email"name="email" id="email" required>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between type="email" and name="email". The formatter will fix this one.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I received all your feedback and I have completed the corrections, and I will definitely create branch next time. Thank you !

<button type="Submit">Submit</button>

</div>

<div>
<label for="T-shirt colour">Select one T-shirt colour:</label>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for="T-shirt colour" but the select below is now id="T-shirt-colour". They have to match exactly. Same on line 44.

<select name="T-shirt colour" id="T-shirt colour" required>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An id can't contain spaces, and a name shouldn't either. Try submitting the form and look at what appears in the address bar for this field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ids and names fixed. The for on the labels wasn't updated to match, so they've come apart. See the comment on line 34.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matching now. Good.

<option value="">Choose one colour</option>
<option>Black</option>
<option>Navy blue</option>
<option>Grey</option>
</select>

<button type="Submit">Submit</button>
</div>

<div>
<label for="T-shirt Size">Select one size:</label>
<select name="T-shirt Size" id="T-shirt Size" required>
<option value=""> Choose one size</option>
<option>XS</option>
<option>S</option>
<option>M</option>
<option>L</option>
<option>XL</option>
<option>XXL</option>

<button type="Submit">Submit</button>
</select>

</div>









<!--
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
Expand Down
Loading