jalghizzi / dropdown-check-list

Automatically exported from code.google.com/p/dropdown-check-list
0 stars 0 forks source link

dropdown check list breaks validation; Asp MVC 3 Razor View #277

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
** What steps will reproduce the problem?
Model variables with the attribute [Required] wont get validated when dropdown 
ddcl is applied.

View element:
Html.ListBox("ProductListBox", new MultiSelectList(Model.ProductList, 
"Product_ID", "ProductName"), new { @class = "multiSelect"})

DDCL:
<!-- Apply dropdown check list to the selected items  -->
<script type="text/javascript">
    $(document).ready(function () {
        $(".multiSelect").dropdownchecklist({ emptyText: "Please select ..." }); 
    });
</script>

Model:
[Required(ErrorMessage = "Product missing.")]
public IEnumerable<Product> ProductListbox { get; set; }

** What is the expected output? What do you see instead?
When submitting the form containing the ListBox, the validation Error must 
occur. This happens when the ddcl is removed from the site.

** What is your environment?
-- DropDownCheckList version: 1.4
-- jQuery version: 1.6.1 (also tried 1.7.1)
-- jQuery UI version: 1.8.13 (also tried 1.8.20)
-- Browser and version: IE 9

** Please provide any additional information below/Please attach sample
html
Generated HTML looks as follows:
<select data-val="true" data-val-required="Product missing." 
id="ProductListbox" multiple="multiple" name="ProductListbox" 
class="multiSelect"> 

Original issue reported on code.google.com by stefan.l...@gmail.com on 12 Dec 2012 at 9:19