Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Form becomes valid after tabbing out of fields #3

Closed
PranavChikodi opened this issue Feb 27, 2014 · 2 comments
Closed

Form becomes valid after tabbing out of fields #3

PranavChikodi opened this issue Feb 27, 2014 · 2 comments
Labels

Comments

@PranavChikodi
Copy link

  1. Have only two fields in the web page
  2. add validation attribute to the fields
  3. even if fields are marked with required in validation attribute after tabbing out of the fields, form gets validated i.e., 'Save/Submit' button gets enabled

I debugged it found that 'regex.test(value);' will return true for undefined value, it converts
undefined to a string value and then checks with regular expression

@ghiscoding
Copy link
Owner

Can you provide your code please so I could test with it? You could push a fix if you find a good way... I might check the required & undefined first...maybe something like this: isValid = (patterns[j] === "required" && typeof value === "undefined") ? false : regex.test(value);

@ghiscoding
Copy link
Owner

Can you try with the piece I posted and see if it work? I'd like to know if it's ok on your side before making a commit on Github... I can't reproduce your problem, so I'd like you to post feedback if possible... Thanks

@ghiscoding ghiscoding added the bug label Jul 6, 2014
ghiscoding pushed a commit that referenced this issue Apr 9, 2015
ghiscoding added a commit that referenced this issue Apr 9, 2015
Bumped to version 1.3.16 after Merge #3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants