abpframework / abp

Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.27k stars 3.32k forks source link

Better/Clearer documentation for abpAjaxForm/data-ajaxForm related to form validation/exception handling #19572

Open matheusware opened 2 weeks ago

matheusware commented 2 weeks ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

I happened to have to "render the form myself", as mentioned in the Forms Validation documentation, while developing a page. I noticed that exceptions for posted forms trigger a full .NET exception screen instead of the SweetAlert popup error message that is shown when you use a form inside a modal. After some (not insignificant) amount time searching online, I arrived at a Stack Overflow answer that pointed me to the abpAjaxForm method. This method can be used to make a regular form be posted via AJAX and, with that, have exceptions be handled with pretty popup messages and such.

ps: I also found a question from some years ago on the abp.io support forum requesting a method to show such messages on a form, but it also didn't mention the abpAjaxForm solution

Describe the solution you'd like

The only place I found mention of the methods needed for turning a regular form into an AJAX form was here. If possible, it would be appreciated if the data-ajaxForm="true" attribute could be mentioned on the ABP Form Tag Helpers documentation as a method of automatically handling exceptions within the existing JavaScript workflow.

Additional context

I'm unsure of the specific language that could be used on the tag helpers page to refer to the data-ajaxForm="true" attribute, but I believe that simply mentioning it there would make it significantly easier for people with the same need to figure this out in the future.

matheusware commented 2 weeks ago

It appears there's already an issue related to this: #12262