Umbraco Forms - how to add TempData if ModelState is invalid
I'm using a blocklist editor with a Form component (that simply has a title and Form Picker) in my U10 project.
If the user doesn't fill in the form correctly, I need the form to return TempData, for example TempData["Invalid"] so that I can check this on the front end and then show a notification that the form was not filled out correctly. I am also needing to include some javascript if the form is invalid so that the browser window will move to the top of the form component.
Umbraco Forms - how to add TempData if ModelState is invalid
I'm using a blocklist editor with a Form component (that simply has a title and Form Picker) in my U10 project.
If the user doesn't fill in the form correctly, I need the form to return TempData, for example TempData["Invalid"] so that I can check this on the front end and then show a notification that the form was not filled out correctly. I am also needing to include some javascript if the form is invalid so that the browser window will move to the top of the form component.
I am using a tag helper to render my form:
How can I make it so I am returning this TempData? Do I need to implement a view component or something?
is working on a reply...