How to set a maximum length on a TelerikAutoComplete input component?

1 Answer 192 Views
AutoComplete
Rob
Top achievements
Rank 1
Iron
Iron
Rob asked on 25 Oct 2022, 02:46 PM

Hi,

Is it possible to set the maximum length of the data entered into a TelerikAutoComplete component?

I've tried catching keystrokes on the component and throwing away the surplus but this is not acceptable to our users.

Cheers
Rob

 

1 Answer, 1 is accepted

Sort by
0
Hristian Stefanov
Telerik team
answered on 28 Oct 2022, 11:28 AM

Hi Rob,

The desired result is easily achievable through the "ValueChanged" event and an "if" block that checks for the value length.

Here is one way you can do it - REPL link. Please run and test the REPL sample to see the result.

Regards,
Hristian Stefanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
AutoComplete
Asked by
Rob
Top achievements
Rank 1
Iron
Iron
Answers by
Hristian Stefanov
Telerik team
Share this question
or