Mikke.Learns

Coding log 05.20.2019

May 19th, 2019

Today I started the Survey Form challenge on fCC, and managed to pass all the test cases. That doesn’t mean that the job is done.

The form has no design, and it’s input fields are generic and boring. I want to make it prettier and more exciting before moving on to the next project.

This is the current code:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Survey Form</title> </head> <body> <h1 id="title">Survey Form</h1> <p id="description">This is a short intro and / or explanation for the survey</p> <form id="survey-form"> <label id="name-label">Name:</label> <input type="text" id="name" placeholder="Please enter your name" required> <label id="email-label">Email:</label> <input type="email" id="email" placeholder="Please enter your email" required> <label id="number-label">Number:</label> <input type="number" id="number" min="1" max="10" placeholder="Please enter a number"> <select id="dropdown"> <option value="One"></option> <option value="Two"></option> <option value="Three"></option> </select> <fieldset name="Radio 1"> <input type="radio" name="Radio1" value="one">One <input type="radio" name="Radio1" value="two">Two <input type="radio" name="Radio1" value="three">Three </fieldset> <fieldset> <input type="radio" name="Radio2" value="four">Four <input type="radio" name="Radio2" value="five">Five <input type="radio" name="Radio2" value="six">Six </fieldset> <fieldset> <input type="checkbox" value="One"> One <input type="checkbox" value="Two"> Two <input type="checkbox" value="Three"> Three </fieldset> <textarea>Please write your message</textarea> <button type="submit" id="submit">Submit</button> </form> <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script> </body> </html>

I’ve fulfilled all the following use cases:

  • User Story #1:

     I can see a title with id="title" in H1 sized text.

  • User Story #2:

    I can see a short explanation with id="description" in P sized text.

  • User Story #3:

     I can see a form with id="survey-form".

  • User Story #4:

    Inside the form element, I am required to enter my name in a field with id="name".

  • User Story #5:

     Inside the form element, I am required to enter an email in a field with id="email".

  • User Story #6:

    If I enter an email that is not formatted correctly, I will see an HTML5 validation error.

  • User Story #7:

    Inside the form, I can enter a number in a field with id="number".

  • User Story #8:

    If I enter non-numbers in the number input, I will see an HTML5 validation error.

  • User Story #9: 

    If I enter numbers outside the range of the number input, which are defined by the 

    min and max attributes, I will see an HTML5 validation error.

  • User Story #10:

    For the name, email, and number input fields inside the form I can see corresponding labels that describe the purpose of each field with the following ids:

    id="name-label"id="email-label", and id="number-label".

  • User Story #11:

    For the name, email, and number input fields, I can see placeholder text that gives me a description or instructions for each field.

  • User Story #12:

    Inside the form element, I can select an option from a dropdown that has a corresponding id="dropdown".

  • User Story #13:

    Inside the form element, I can select a field from one or more groups of radio buttons. Each group should be grouped using the name attribute.

  • User Story #14:

    Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.

  • User Story #15:

    Inside the form element, I am presented with a textarea at the end for additional comments.

  • User Story #16:

    Inside the form element, I am presented with a button with id="submit" to submit all my inputs.

survey1

Survey2