Code Monkey home page Code Monkey logo

formvalidation's Introduction

Validation of form Condition: Validate form fields must be in the process of filling (but not show error messages until user has entered something). Form will not be sent by click, if there are errors. In this case, the submit button must to be inactive. Fields with an error should be highlighted, indicating the specific error.

Possible error situations:

  • The field must be filled, not filled
  • Error in email (checked using regexp)
  • email is already registered (consult with [a static list of email-s, which is stored in the global variable usedEmails,] or by reference ajax-request to the server https://aqueous-reaches-8130.herokuapp.com/)
  • The password is too short (five characters or less)
  • Password is too easy (only numbers, only letters)
  • Password contains illegal characters (allowed - letters, numbers, underscore and hyphen)
  • International telephone recording format (+ 38xxxxxxxxxx) is not sustained
  • Checkbox "I agree with everything" is not checked
  • Name and data - alphanumeric characters

Solution works in IE9+

Валидация формы Условие: Валидировать поля формы необходимо в процессе набора (но не показывать ошибки до того, как пользователь что-то ввел). Форма не должна отправляться по клику, если при заполнении возникли ошибки. В этом случае кнопка отправки формы должна быть неактивной. Поля с ошибкой должны подсвечиваться, сообщая о конкретной ошибке.

Возможные ошибочные ситуации:

  • Поле, обязательное для заполнения, не заполнено
  • Ошибка в email (проверяется при помощи regexp)
  • email уже зарегистрирован (сверяться либо со статическим списком email-ов, который хранится на глобальном уровне в переменной usedEmails, либо путем отсылки ajax-запроса на сервер https://aqueous-reaches-8130.herokuapp.com/
  • Пароль слишком короткий (5 или менее символов)
  • Пароль слишком простой (только числа, только буквы)
  • Пароль содержит запрещенные символы (разрешенные - латинские буквы, цифры, подчеркивание, минус)
  • Международный формат записи телефона (+38xxxxxxxxxx) не выдержан
  • Checkbox "Согласен со всем" не отмечен
  • Имя и данные - буквенно-цифровые символы

Реализация работает в IE9+

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.