Giter Site home page Giter Site logo

mc-client-side-validation-solutions's Introduction

Client Side Validation

In this challenge, you'll be styling and validating a sign up form, a common use case for client side validation.

what is client side validation?

Client side form validation is the process of testing, and ensuring, that the user has entered required and properly formatted information through the web form. Client side validation is done on the client side - i.e. on the user's browser.

Pros
  • visually informs users about errors they may have made when inputting information, i.e.
    • empty mandatory fields
    • passwords not matching when registering
    • email address not in the right format
    • any time you want to control the format in which a user enters information into an input (e.g. form or post data)
  • saves resources as you do not have to make a call to the server to check if a user's data is inputted in a valid format
Cons
  • not 100% fool-proof
  • no matter how much front-end validation you have, you should still validate on the server side to ensure that your form is secure

The task

validation-challenge-1

Challenge

You'll be making a sign up form which is validated on the client side.

Technical requirements:

  • don't use inline HTML handlers
  • html5 comes with it's own pop up windows for validation. You'll be creating your own custom warning messages, so you should use the attribute which overrides this default behaviour
  • add rules to the password field, so that you can guide users to create stronger passwords

Steps

Firstly, style the form using the design as a guide. Making your own stylistic choices is strongly encouraged.

Then, satisfy the following requirements for when the user clicks the submit button:

  • if the passwords do not match, please provide a warning as shown in screen two
  • if the email is not valid, please provide a warning as shown in screen 3
  • if any of the fields are empty, please provide a warning as shown in screen 4
    • if email is empty, warning should say 'please enter an email address'
    • if password or confirm password are empty, warning should say 'please enter a password'

Stretch goals

  • when the user does not satisfy these rules, let them know before they click the submit button
  • now that you can present feedback to the user before they press submit, go back and refactor your previous solutions to do the same

mc-client-side-validation-solutions's People

Watchers

 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.