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

Unable to get the regular expression working on a form input field when trying to submit #683

Open
dSunfield opened this issue Aug 7, 2020 · 0 comments

Comments

@dSunfield
Copy link

Hello!

Im currently trying to get the field inputs to work with the use of regular expressions. I am however experiencing some issues when trying to 'submit' the form (and adding a submit prevent to log the current model).

code on JSfiddle: https://jsfiddle.net/qb1jurzh/8/

when clicking preview model, even when the regexp result is valid, the (browser)? still somehow shows the error.

I tested with the following values:

  • "" -> shows that the field is required, which is correct.
  • 1 -> this doesnt follow the regexp, shows correct error.
  • 11 -> this follows the regexp, still shows error when "submitting".

I expect the model to be printed in de console because the regular expression returns trueyet it just doesn't work for some reason. Am I missing something or... ?

I know that you can just change the inputType to "number" and fixing it that way, I am just making this example more simple. I want to add more complex regexp which mixes numbers and strings etc.

~ Thanks!

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

No branches or pull requests

1 participant