Giter Club home page Giter Club logo

exercise-html5-form-validations's Introduction

HTML5 Form Validations

After building the HTML and CSS for this form, we need to make sure it prevents the user from submitting a form with the wrong information or format, in web development we call that: Form Validations, you can read more here

To prevent a form submission, we have to listen to the "submit" event that is triggered by the form itself when the user presses either: the enter/return key or the submit button.

Here is a little more about preventing an event from occurring: https://www.youtube.com/watch?v=I_fVO_NzT2g&t=401s

Form Validations Preview

๐ŸŒฑ How to start this project

Do not clone this repository.

The first step to start coding is cloning the vanillajs boilerplate on your local computer or opening it using gitpod.

a) If using Gitpod you can clone the boilerplate by clicking here.

b) If working locally type the following command from your command line: $ git clone https://github.com/4GeeksAcademy/vanillajs-hello.

๐Ÿ’ก Important: Remember to create a new repository, update the remote (git remote set-url origin <your new url>), and upload the code to your new repository using add, commit and push.

Instructions

After the user submits the form:

  1. Make sure to stop the flow of the submission using preventDefault(), here is a little bit more about preventDefault().
  2. After preventing the submission, make sure all the input values are correct and properly formatted.
  3. If there are one or more inputs with an invalid value, show a clear error on the top of the form with a very explicit message about what happened.
  4. Change the background color of the relevant inputs (the ones with incorrect data).

What to do if you are stuck?

Don't get frustrated and ask for help! After trying on your own for 20 min, it is time to stop working and ask for help.

๐Ÿค  Feeling Confident?

This additional requirement is not mandatory to complete the project:

Make the form errors show on top of each input instead of on the top of the form, that way the user will understand faster what the problem is about.

exercise-html5-form-validations's People

Contributors

alesanchezr avatar elviraqdp avatar jimenaeb avatar lorenagubaira avatar mortegac avatar tebanban avatar tommygonzaleza avatar

Watchers

 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.