Giter Site home page Giter Site logo

html-forms-lab-re-coded_sanaa_web001's Introduction

HTML Contact Form Lab

Problem Statement

Business of all types and sizes want to provide multiple ways for their potential customers to contact them. One of the most common ways to do this is on a website is to provide a contact form.

In this lab, we will practice what we've learned about HTML forms by creating a contact form similar to those we see on business websites.

Objectives

  1. Apply what we know of HTML forms to build a functional a contact form

Reinforcing Our Understanding of HTML Forms

To see and test your form in action, run httpserver or open index.html in a new browser tab. To test your work, run learn.

Some basic HTML has been provided for this lab, along with HTML comments on what is needed. Follow the provided comments and test messages to see what is needed when creating the form. At completion, your form should have:

  • A required text input for a full name with a placeholder, "Enter Name"
  • A required email type input for an email address with a placeholder, "Enter Email"
  • A tel type input for a telephone number with a placeholder, "Enter Telephone (optional)"
  • A text area for a user to include a message with a placeholder, "Enter Message"
  • Labels for each text input
  • A checkbox with text of your choosing
  • A submit button

The required Attribute

The required attribute prevents the browser from submitting a form. All required inputs must be filled in properly, preventing an unneeded page reload. This functionality is baked into HTML5 for us automatically. All that is needed is to include the word required as an attribute, without setting it to any value.

When an input is required, the type attribute (e.g., text vs email) will determine what the browser checks. In the case of an email, for instance, the input must match the format of an email address, including the "@".

Conclusion

Forms are an essential way for users to submit data to a website. Some forms, like search bars, only contain a single input field, but we can make them as complex as we need.

We are only focused on building out the front end side of this form. When a form is submitted, it is up to the backend of a website to decide how to handle and store form data when submitted.

View HTML Map Contact Form Code-along on Learn.co and start learning to code for free.

html-forms-lab-re-coded_sanaa_web001's People

Contributors

annjohn avatar crwhitesides avatar eleanorgraham avatar gj avatar jmburges avatar jonbf avatar jongrover avatar juangongora avatar maxwellbenton avatar mysticriver avatar pletcher avatar samegel avatar sarogers avatar scottibe avatar sgharms avatar sophiedebenedetto avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.