Giter Site home page Giter Site logo

html-forms's Introduction

HTML forms and form elements

Setup

  • Fork
  • Clone
  • CD into the directory
  • Run open index.html

When you add HTML elements to the forms, and click the button, you will see a table of types / names / values appear below. This is how you'll know you did it correctly.

Resources

Challenge #1

Inside the form in index.html add some fields:

  • add two inputs with the type "text"
    • give one a value
  • add two textareas
    • give one some pre-filled text
  • add an input of type "email"
  • add an input of type "date"
  • add an input of type "number"
  • add an input of type "file"
  • for each input and textarea, add a label with a for attribute that matches
  • add unique names and ids to each
  • make one of the text fields have focus when the page loads
  • give one of the fields some placeholder text
  • add a submit button (input with a type of submit)
    • submit the form and inspect the results

Challenge #2

  • in the example_02.html file add a form
    • set the method and action to send a get request to the example_02.html page
  • add 2 hidden fields, give each a unique name and value
  • add three inputs with the type "checkbox"
  • wrap each checkbox in a label with some text
  • make one checkbox checked by default when you load the page
  • make one checkbox have the same name as a hidden field
  • add a submit button (a button with a type of submit)
    • submit your form, inspect the results

Challenge #3

  • in the example_03.html file add a form
    • set the method and action to send a get request to the example_03.html page
  • add a fieldset with a legend for "Size"
    • add three radio buttons, for small, medium and large, each with a label
    • give each the same name and different values
  • add a fieldset with a legend for "Color"
    • add three radio buttons, for blue, red and yellow, each with a label
    • make "red" pre-selected when the page loads
  • Add a submit button (input or button), submit your form and inspect the results

Challenge #4

  • in the example_04.html file add a form
    • set the method and action to send a get request to the example_04.html page
  • add 4 select boxes with options
  • in the first
    • add options with values and text
    • make one of them selected by default when the page loads
  • in the second, add options with just text
  • in the third, add some options with blank values
  • make the 4th a multi-select box
  • add labels for all select boxes
  • add a submit input or button, submit the form and inspect the results

Extra:

  • add optgroups with labels to group options

Challenge #5

In example_05.html, make a form that looks like this:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.