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

Bug - pattern does reject input incorrectly #83

Open
JANHMS opened this issue Jan 26, 2023 · 2 comments
Open

Bug - pattern does reject input incorrectly #83

JANHMS opened this issue Jan 26, 2023 · 2 comments

Comments

@JANHMS
Copy link

JANHMS commented Jan 26, 2023

Thanks for creating this tool. I copied the .js file and included it in my HTML script:

   <script src='./validator.js'></script>

I was trying to use it in my HTML code like so:

<div class="row">
  <div class="col">
      <div class="form-group">
          <label for="name">name</label>
          <input pattern="alphanumeric" data-validate-length-range="2" data-validate-words="1" name="name" placeholder="Mustermann" required="required" class="form-control" type="text" value="{{item.name}}">
      </div>
  </div>

However this does not work. I just type characters like and I receive an issue, that the field does not fullfil the pattern, even though it should work fine -> so a False Positive.
However, it works fine, when I do not use the pattern variable, but fails with it. I also tried to use numeric and then type e.g. 12345, which did not work neither.

Any idea? (I tried on Edge)

@JANHMS JANHMS changed the title Bug - pattern does reject incorrectly Bug - pattern input does reject incorrectly Jan 26, 2023
@JANHMS JANHMS changed the title Bug - pattern input does reject incorrectly Bug - pattern does reject input incorrectly Jan 26, 2023
@yairEO
Copy link
Owner

yairEO commented Jan 26, 2023

And what was the false-positive input which you were typing?
"alphanumeric" is only alphabetical letters & numbers. Not < or < characters,
so an input such as the one you have mentioned above - <12345> should be marked as invalid,
as can be seen in this project's demo page:

http://yaireo.github.io/validator

validator.mp4

@JANHMS
Copy link
Author

JANHMS commented Jan 27, 2023

Yes I typed 12345 not <12345>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants