This is my problem:
I'm working with ASP.NET MVC framework, I'm creating new records on a database with a "Create" view, that receives a Viewmodel in order to send the data from client to server.
I implemented some properties validations with Data Annotations in my ViewModel definition, such as "Required", "Range", "DataType", most of my inputs are validated correctly before sending the request to server side, except one.
This input's value is a concatenated string, containing all the Options the user selected from a Dropdownlist. I update this input value with javascript, every time the user selects an option.
For that I'm implementing the @Html.HiddenFor(m => m.propX) helper, so when the user selects an option, I updated the propX value.
This works fine, even the values selected by the user are binded correctly in the ViewModel, and I can read this input's value on server side, the problem comes when this input is emtpy, because the field is not validated since it's defined as Required in the ViewModel I should get a validation message, saying that, but no, I don't get any message and my submit request is sent to the server.
Any ideas why this @Html.HiddenFor(m=> m.propX) input is not validated? How can I force this input's validation before sending the request to server.