Comments (7)
I'm so sorry, but it's no clear to me what you're trying to say. Have you tested it? The demo page uses on-page patterns
and it works as-is.
from bouncer.
I'm sorry, mister. My bad.
I think, despite you have give up on using the native API, the validation has to be the same.
From the specification:
[...] the regular expression language used for this attribute is the same as that used in JavaScript, except that the pattern attribute is matched against the entire value, not just any subset (somewhat as if it implied a
^(?:
at the start of the pattern and a)$
at the end).
Which makes the ^
and $
on some demo samples unnecessary and allows some pattern mismatches. For example, your demo of the telephone number, matches 123-456-7890
, but also 00000000000000123-456-7890
, ABCD123-456-7890
or 123-456-7890-this RegEx's start isn't anchored to the start of the string neither its end is anchored to the end of the string
.
There's still the case of the multiple
attribute, which requires the RegEx to be tested on each value and the RegEx flag:
[..] compiled as a JavaScript regular expression with only the "u" flag specified [...]
I can submit a pull request, if you want to.
from bouncer.
Ah yes, I see what you mean. I... I suck at regex!
Yes, a pull request would be AWESOME, thank you!
from bouncer.
@cferdinandi , may I add the lock and changelog files?
from bouncer.
No thanks. I use tags for changelog.
from bouncer.
Wow, I wasn't talking about the release, but something to help others of analyze the changes in the future. It can be useful.
Pull request submitted!
from bouncer.
Fixed with v1.0.3. thanks for this, @robsonsobral !
from bouncer.
Related Issues (20)
- File validation problems HOT 1
- bouncerFormValid doesn't fire until re-submission of form HOT 2
- aria-required HOT 2
- getErrorLocation HOT 7
- Validating group of checkboxes (at least one required) HOT 1
- Reset validation HOT 1
- Error messages translations (Localization)
- Validation on form submit only HOT 1
- if I have two form in a page. How can I call bouncerFormValid two times for 2 form? HOT 1
- Documentation: form onsubmit preventDefault no effect without disableSubmit true
- Config of error message : Failure when defined via function + constraint is outOfRange or wrongLength HOT 2
- How can i validate two field is equal? HOT 2
- Age Validation
- Hidden/not visible fields are validated HOT 2
- Validating dynamically populated select
- Google Recaptcha stops bouncer HOT 4
- type="number" not correctly detected
- Validate Groups with CustomValidation?
- Does not support the multiple attribute for email input
- Issue with preventDefault call in bouncer library HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bouncer.