Skip to content

GLASGOW | MAY_2025 | MOHAMMED HUSSEIN | FORM CONTROL #659

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 4 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
93 changes: 84 additions & 9 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,100 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My form exercise</title>
<meta name="description" content="" />
<title>T-Shirt Selection Form</title>
<meta name="description" content="
t-shirt form " />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<body>
<header>
<h1>Product Pick</h1>
<h1>T-SHIRT PICK</h1>
</header>
<main>
<form>
<!-- write your html here-->
<!--
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
<div>
<label for="name">Name</label>
<input type="text" name="name" id="name" minlength="2" required />
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently a user can enter a name consisting of only space characters (e.g., " "). Can you enforce a stricter validation rule using the pattern attribute to disallow any name that contains only space characters?

</div>
<br />
<div>
<label for="email">Email</label>
<input type="email" name="email" id="email" required />
</div>
<br />
<fieldset>
<legend>Color</legend>
<div>
<label for="green">Green</label>
<input
type="radio"
name="Color"
id="green"
value="green"
required
/>
</div>
<br />
<div>
<label for="red">Red</label>
<input type="radio" name="Color" id="red" value="red" required />
</div>
<br />
<div>
<label for="yellow">Yellow</label>
<input
type="radio"
name="Color"
id="yellow"
value="yellow"
required
/>
</div>
</fieldset>
<br />
<fieldset>
<legend>Size</legend>
<br />
Copy link
Contributor

Choose a reason for hiding this comment

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

The spacing after the <legend> tags in the two

elements is inconsistent. Could you adjust the spacing to ensure consistency between them?
image

<div>
<label for="XS">XS</label>
<input type="radio" name="Size" id="XS" value="XS" required />
</div>
<br />
<div>
<label for="S">S</label>
<input type="radio" name="Size" id="S" value="S" required />
</div>
<br />
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you find out from ChatGPT, "when to use radio buttons and when to use a dropdown list?" You don't have to change your implementation in this exercise.

<div>
<label for="M">M</label>
<input type="radio" name="Size" id="M" value="M" required />
</div>
<br />
<div>
<label for="L">L</label>
<input type="radio" name="Size" id="L" value="L" required />
</div>
<br />
<div>
<label for="XL">XL</label>
<input type="radio" name="Size" id="XL" value="XL" required />
</div>
<br />
<div>
<label for="XXL">XXL</label>
<input type="radio" name="Size" id="XXL" value="XXL" required />
</div>
</fieldset>
<br />

<div>
<button type="submit">Submit</button>
</div>
</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>By Mohammed Hussein</h2>
</footer>
</body>
</html>