Forum Discussion
MarioF2110
Sep 20, 2024Copper Contributor
Checkbox values empty if other form fields are empty when POST form
I have hit a road block on a ASP.NET/Razor Pages project I am working on. I have a form with checkboxes. I have a List<int> field that is bound to the Id of the checkboxes. If I submit the form with ...
- Sep 20, 2024I wanted a nicer looking confirmation window, but I am not sure how to solve the problem. I am going with, "var proceed = window.confirm("You sure")" instead of displaying a Modal. This returns the appropriate bool value form my OnSubmit function until I can learn another away.
MarioF2110
Sep 20, 2024Copper Contributor
The form does have an "return CheckForm()", OnSubmit event defined. It displays a Modal window if the form's textboxes and dropdowns have a certain value. If I remove the OnSubmit function the form checkboxes POSTs correctly. So, if the CheckFrom() function returns true, things work. It's when I display the Modal and return false that I have a problem.
The Modal does use a Form too, if you click "Continue". So now I realize I am calling a Form POST right after the other. Ultimately, my intent is to confirm the user wants to continue with the original/first form's values and do the query the user defined. I would like to keep the code native to ASP.Net Core/Razor Pages if possible, and not use javascript or jquery.
The Modal does use a Form too, if you click "Continue". So now I realize I am calling a Form POST right after the other. Ultimately, my intent is to confirm the user wants to continue with the original/first form's values and do the query the user defined. I would like to keep the code native to ASP.Net Core/Razor Pages if possible, and not use javascript or jquery.
MarioF2110
Sep 20, 2024Copper Contributor
I wanted a nicer looking confirmation window, but I am not sure how to solve the problem. I am going with, "var proceed = window.confirm("You sure")" instead of displaying a Modal. This returns the appropriate bool value form my OnSubmit function until I can learn another away.