Just so others don’t tear their hair out, it seems the xVal client side validation call Html.ClientSideValidation<TModel> converts (all?) non-A-Z characters to an underscore, I knew dots needed to be replaced for underscore, but it seems square brackets need this as well.
So:
<%= this.TextBox("Supplier.SupplierAddresses[" + Model.CurrentRowIndex + "].Address.Postcode").Value(Model.SupplierAddress.Address.Postcode).Class("postcode").MaxLength(4)%>
<%= Html.ValidationMessage("Supplier.SupplierAddresses[" + Model.CurrentRowIndex + "].Address.Postcode")%>
Needs:
<%= Html.ClientSideValidation<Address>("Supplier_SupplierAddresses_" + Model.CurrentRowIndex + "__Address")%>
To actually work and initialise jQuery client-side validation.
Post a Comment