Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Form validation on focusout

hoene-erni free asked 5 years ago


Expected behavior I am looking for a way to activate the validation of a material form field, in the way that it first gets shown when the "focus out" event has been thrown

Actual behavior Currently the validation is live triggered i assume when the onchange event on the field is thrown Resources (screenshots, code snippets etc.) In the screenshot you can see that the validation is directly shown as soon as the user types something. So means user has no chance to first type the correct value there image shows the direct validation on the field


Arkadiusz Idzikowski staff answered 5 years ago


There is updateOn: blur in the Angular form options. Please take a look at our documentation, we added examples for both template-driven and reactive forms:

https://mdbootstrap.com/docs/angular/forms/validation/#template-on-blur


hoene-erni free commented 5 years ago

Hi Arkadiusz, thank you for the feedback! Is there als the option to set "updateOn: onfocusout" here?


Arkadiusz Idzikowski staff commented 5 years ago

Unfortunately not, update on blur/submit are the only options in the Angular validation. Are there any problems caused by updates on blur in your case?


hoene-erni free commented 5 years ago

Hi Arkadiusz, thanks for the feedback, i wasn't aware that onBlur provides probably the same. So we will try that. Thank you



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.0
  • Device: Notebook HP
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No