I have a page that shows a report, and based on a routing parameter it will return a view that displays the data grouped by category or grouped by priority.
I want to add two Radio buttons to the report page that will let the user toggle between the category and priority view when they click on the corresponding radio button.
But I don’t know how to create a form where clicking on either of the radio buttons submits a post request that passes a model object (has the category priority switch, and other values) back to a controller action.
The only way I know of to make selecting a radio button do a post is to use JavaScript:
Here’s the way you could do it in jQuery: