-
Notifications
You must be signed in to change notification settings - Fork 84
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
Primitive Field Type Fields.email(name) #82
Comments
@CreativeWolf like text field with email pattern validation? |
Yes, that'd help :) |
@matteocng Firstly, Thank you for addressing this. Just a request, I understand Angular's default validation has issues with pattern recognition - angular/angular.js#5899 - Not sure if that's been changed now and I might be completely bringing up an unwarranted issue.
References: Looking forward to your feedback. Thanks! |
@CreativeWolf nice point! Yep. As the issue requests we need some email validation. So we can start with client side validation as @CreativeWolf proposed. But I doubt solution with |
Thank you @CreativeWolf for bringing up the issue, I personally find this argument compelling as far as using the default, Chromium derived regex goes. Perhaps adding a layer of server side, non-pattern based validation could be a future evolution (e.g domain, mx, smtp, third party api). |
Fair point indeed. However, in an environment to have some user control, it becomes essential. Of course, as far as there is an option to use ng-pattern or Chromium derived regex or a custom pattern on the fly in a framework like AllcountJS will be highly useful. |
Interesting. @matteocng have you checked that native browser email validation works both in a form and in the grid? It could be a solution. |
@paveltiunov as far as i know a form is needed to get the native UI validation behaviour (native tooltip with natively generated message). @CreativeWolf I agree that letting users add their own custom logic/pattern on top of AllcountJS default validation would be a very useful feature, albeit more complex to implement well. What would you think of a regex('...', 'Message') method in the context of #4? |
@matteocng just checked current behavior. It actually checks but in case email has wrong format it just doesn't save. It would be nice to notify user somehow that email has wrong format. Native tooltip doesn't appear for me. |
@paveltiunov nice find, I've reproduced that behaviour. If you ran the app below, inserted 'a' in all six email, link and quantity fields and saved, the red error label 'Required' would just appear below the required() fields. Then, if you correctly filled in just the three required() fields, the save action would complete by saving 'null' in the DB for the three optional fields. As you correctly pointed out, it would be nice to 1) block the save action if invalid data was inserted in an optional field, showing an error label below it 2) change the 'Required' error label with a different message when the issue was a validation error; this change would affect both required and optional fields.
|
@matteocng Ah. I see. Nice workaround with |
@paveltiunov Yes, moved to #91. |
@matteocng Ok. Nice. Will close this one then. |
It'd be good to have a Primitive Field Type Fields.email(name)
The text was updated successfully, but these errors were encountered: