Yeah we can pass validation function just like formLogin. If you have lot's of forms in your website then passing validation function makes more sense.
When you have multiple forms in your application, then you will need different validations as per the different fields of the forms and it becomes hard to manage if we keep adding validations for all the fields in just one function. That's why it is best to create separate validation functions for separate form then pass it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for this article.
I think that this hook can be improved if we can find a way to pass validation function as parameter. What do you think about that ?
Yeah we can pass validation function just like formLogin. If you have lot's of forms in your website then passing validation function makes more sense.
why you want to pass validation function as parameter
When you have multiple forms in your application, then you will need different validations as per the different fields of the forms and it becomes hard to manage if we keep adding validations for all the fields in just one function. That's why it is best to create separate validation functions for separate form then pass it.