Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
OrchardCore.Forms will store model state in a cookie so in the event the form is invalid the user can be redirected back to the form with the model state still intact.
Orchard Core version
Main branch as of 05bd65ab262bbee90b63bb23b6f021b7a8c9d820
To Reproduce
Create a new site using the blog recipe.
Enable the OrchardCore.Forms feature.
Add a new form widget to the "content" zone and "always" layer. In the form's flow:
Add the Validation Summary widget.
Add the Input widget.
Name: MyName
ID: MyName
Label option: Standard
Label text: Name
Type: Input
Validation option: Standard
Add the Input widget.
Name: MyCheckbox
ID: MyCheckbox
Label option: Standard
Label text: Click me
Type: Checkbox
Validation option: Standard
Add the Button widget
Name: MyButton
ID: MyButton
Text: Submit
Type: Submit
Add a new workflow like the image below. The idea is to submit the form and force a validation error on the checkbox, then redirect back to the form to display the error.
Copy the action from the Http Request Event and set that as the form action back in the form widget.
Uncheck "validate antiforgery token" from the Http Request Event.
If you get stuck I modified the example "contact" form from the OC docs
View the form
Fill out the form
Submit the form. The text input state is preserved. The checkbox state is not preserved.
Expected behavior
Checkbox state is preserved across the redirect (the checkbox remains checked if it was checked when submitted).
Describe the bug
OrchardCore.Forms will store model state in a cookie so in the event the form is invalid the user can be redirected back to the form with the model state still intact.
Orchard Core version
Main branch as of 05bd65ab262bbee90b63bb23b6f021b7a8c9d820
To Reproduce
If you get stuck I modified the example "contact" form from the OC docs
View the form
Fill out the form
Submit the form. The text input state is preserved. The checkbox state is not preserved.
Expected behavior
Checkbox state is preserved across the redirect (the checkbox remains checked if it was checked when submitted).