Skip to content

Instantly share code, notes, and snippets.

@aozora
Last active January 10, 2018 10:56
Show Gist options
  • Save aozora/59aeaaba8512e0fa86880eee3e414626 to your computer and use it in GitHub Desktop.
Save aozora/59aeaaba8512e0fa86880eee3e414626 to your computer and use it in GitHub Desktop.
<!--
This form ha several markup errors: please fix them.
-->
<form action="/" method="SEND">
<span>User Name:</span>
<input type="number" placetext="Write your user name" id="username">
<span>Password</span>
<input type="text" placetext="Write your secret password" id="password">
<button type="button">Submit this form</button>
</form>
@aozora
Copy link
Author

aozora commented Jan 10, 2018

Solution:

  1. the form method is invalid, should be "POST"
  2. as field labels it's not correct to use the span, but a label with the "for" attribute
  3. the type for both inputs are incorrect (text the first, password the last)
  4. the attribute "placetext" is incorrect, should be "placeholder"
  5. the button type attribute must be "submit"
<form action="/" method="POST">
  <label for="username">User Name:</label>
  <input type="text" placeholder="Write your user name" id="username">

  <label for="password">Password</label>
  <input type="password" placeholder="Write your secret password" id="password">

  <button type="submit">Submit this form</button>
</form>  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment