I have a C# MVC application and a <form>
in my page.cshtml
file. In that form I have <input type="text" ... />
elements. If I submit this form I only get the values in Response.Params
or Response.Form
from the inputs where I changed the value manually (i.e. Entered the text box then typed something).
If I change the value with jQuery, $('#myInput').val('some value');
this does not count as a change in the input's value and I do not get myInput
's value when I submit the form.
Is there any way to make sure all inputs are submitted? If not then is there a good workaround for this, maybe in some event that occurs before my model gets bound? I need to know all the input values from the form when submitted whether they changed or not.
Some additional info:
The form and other values are getting submitted correctly and I am receiving my model when the POST action is called in my controller.
The real issue is when my model is being bound. It is being created and bound with all values except the one not being submitted because it is not in the Request.Params
collection.