This is a migrated thread and some comments may be shown as answers.

maxLength?

4 Answers 262 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 2
Jay asked on 18 Sep 2013, 10:13 PM
Hi,  I am using the kendoComboBox as well, a combo box.  I need to be able to limit users input length to a number of characters, just like I do on my other input boxes.  There doesn't appear to be a maxLength parameter for the comboBox.  I'm guessing that I must be missing something.  Can someone help?

4 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 19 Sep 2013, 10:52 AM
Hello Jay,

You can easily set a maxlength attribute to the <input> element from which the Kendo UI ComboBox is created. Alternatively (if the widget is created from a <select>), you can set the attribute via Javascrript after initialization.

comboObject.input.attr("maxlength", 3);

http://docs.kendoui.com/api/web/combobox#fields-input


Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jay
Top achievements
Rank 2
answered on 19 Sep 2013, 05:57 PM
Yes, I already set the maxlength via jquery, however it just seems to be an oversight that the control does not have the ability on it's instanciation objects to handle maxlength.   Your other input controls have it, and every development comboBox I have ever used supports it.  Could you please consider adding it to the list of items to do on the ComboBox?  Obviously, it would only take one or two lines of code to implement it.
0
Dimo
Telerik team
answered on 20 Sep 2013, 06:46 AM
Hello Jay,

None of the Kendo UI input widgets have a maxLength configuration option - I am not sure where you have seen this. Since we rely strongly on native HTML elements, they allow setting such attributes in a standard way.

We can consider adding a maxLength option depending on customer demand. You can vote for it on our feedback portal.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jay
Top achievements
Rank 2
answered on 20 Sep 2013, 06:20 PM
My bad, your controls don't support shortcut setting the maxlength via the Json options object.  It would be helpful, i'll go vote for it.
Tags
ComboBox
Asked by
Jay
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Jay
Top achievements
Rank 2
Share this question
or