maxLength?

5 posts, 1 answers
  1. Jay
    Jay avatar
    45 posts
    Member since:
    Dec 2011

    Posted 18 Sep 2013 Link to this post

    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?
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 19 Sep 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Jay
    Jay avatar
    45 posts
    Member since:
    Dec 2011

    Posted 19 Sep 2013 Link to this post

    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.
  5. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 20 Sep 2013 Link to this post

    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!
  6. Jay
    Jay avatar
    45 posts
    Member since:
    Dec 2011

    Posted 20 Sep 2013 Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready