jquery-chosen

jQuery Chosen Dropdown validation client site doesn't work

扶醉桌前 提交于 2019-11-26 11:40:32
问题 My model class contains of required lookup value which is a lookup-based record: [Required] [DisplayName(\"Business Unit\")] public string value { get; set; } [Required] //not working on client side? [DisplayName(\"Business Group\")] public int id_businessgroup { get; set; } View: <div class=\"editor-label\"> @Html.LabelFor(model => model.value) </div> <div class=\"editor-field\"> @Html.EditorFor(model => model.value) @Html.ValidationMessageFor(model => model.value) </div> <div class=\"editor

How can I use jQuery validation with the “chosen” plugin?

荒凉一梦 提交于 2019-11-26 08:05:22
问题 I have some <select> inputs using the chosen plugin that I want to validate as \"required\" on the client side. Since \"chosen\" hides the actual select element and creates a widget with divs and spans, native HTML5 validation doesn\'t seem to work properly. The form won\'t submit (which is good), but the error message is not shown, so the user has no idea what\'s wrong (which is not good). I\'ve turned to the jQuery validation plugin (which I planned on using eventually anyways) but haven\'t