MVC: How to make the DropdownList field (with the selected plugin) mandatory

I declared a parameter in my model as

[Required]
public int? param{get; set;}

and defined it in the drop-down list. Everything works fine, and data validation works until I add a plugin, Chosen . When I add the plugin, there is no confirmation for the submission. How can I save data validation when a plugin is applied to a Select element?

+5
source share
1 answer

As suggested here , I went to the selected js file and changed this.form_field_jq.hide () to 'this.form_field_jq.css ("position", "absolute") CSS ("left", "- 9999px").

+4
source

All Articles