-
-
Notifications
You must be signed in to change notification settings - Fork 151
add a case-insensitive variant of Form::PATTERN #187
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
Conversation
dd41d13 to
46d72e9
Compare
Some old browsers (such as PhantomJS used for testing) do not support I fixed it in e3b5529 |
src/assets/netteForms.js
Outdated
| }, | ||
|
|
||
| pattern: function(elem, arg, val) { | ||
| pattern: function(elem, arg, val, value, modifiers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that argument caseInsensitive is better than modifiers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. The same for the PHP bit then?
pub fun xxx(..., bool $caseInsensitive = false) {
$modifiers = 'u' . ($caseInsensitive ? 'i' : '');
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
46d72e9 to
7d632f4
Compare
|
@dg Rebased and adjusted. Let me know if you need anything else. Thank you. |
|
Great, thanks! |
|
@dg Dope! Thank you. If you could back-port it to v2.4 that would be even more awesome :-) |
|
Done |
…ploads (#719) * documents nette/forms#186, nette/forms#187 and nette/forms#175
…ploads (#719) * documents nette/forms#186, nette/forms#187 and nette/forms#175
…ploads (#719) * documents nette/forms#186, nette/forms#187 and nette/forms#175
This adds an option to validate form controls like via
Form::PATTERN, but with case-insensitive regexp.I have a question about the
uregexp modifier. It is used in the PHP code, but not in the JS code. However, when I add it to the JS code, the tests break. Do you have more info on this? I thought this would result in enabled case folding on both sides consistently, but ... I don't know, this is not my area of expertise.Appreciate any pointers / ideas for improvements.
Thank you.