Pending Review
Last Updated: 18 Jul 2025 18:10 by Emily
Emily
Created on: 18 Jul 2025 18:10
Category: UI for ASP.NET MVC
Type: Bug Report
3
Using [MaxLength] on Property Limits ComboBox Filtering

I have a Kendo ComboBox() on CountryCode property that has [MaxLength(2)] data annotation on the property in the ViewModel. This is limiting the filtering on the ComboBox and I can't type more than 2 characters in the component. Please see the sample project for the reproduceable issue.

Upon inspecting the markup generated by the Kendo ComboBox(), I'm seeing that there are 2 inputs being generated and maxlength HTML attribute is applied to both.

  • The first input tag is displayed to the user and used for filtering. This should NOT have maxlength HTML attribute since it incorrectly limits the number of characters the user can filter by.
  • The second input tag is a hidden input that passes the selected data value for form submission. This correctly has the maxlength HTML attribute to still enforce validation.

When I manually removed the maxlength HTML attribute from the first input tag, this fixed the filtering of the ComboBox while still retaining the validation on the second input tag.


Please review the markup generated by the Kendo ComboBox() and see if it can be fixed to remove maxlength from the first input tag.

Expected behavior:

If [MaxLength] is applied to a property, it should generate a markup that allows the user to filter without character limitation while still validating against the selected data value.

Attached Files:
0 comments