Skip to content

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

New issue

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

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

Already on GitHub? # to your account

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!

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

No branches or pull requests

1 participant