Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only validate onblur of the field, and only if it's been edited #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 16, 2021

  1. Only validate onblur of the field, and only if it's been edited

    The process of editing the field (the 'input' event) will activate
    the field for validation, and then the blur event does the actual
    validation.
    
    This means that clicking into (or tabbing into) a field won't do
    anything if you then leave that field UNLESS if you actually enter
    some content into the field; once some input has occurred, then the
    field is active, and from then onwards the blur events will trigger
    validation.
    
    Not the most efficient code (especially for radio/checkbox) due to
    the double-events, but it works. Could be made better by removing
    the 'input' event handler upon first use.
    
    Tested on Firefox/Linux and Chrome/Linux, with entering fields,
    inputting fields, chrome autofill, etc.
    TheJosh committed Apr 16, 2021
    Configuration menu
    Copy the full SHA
    b8ec1d4 View commit details
    Browse the repository at this point in the history