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

Prevent Default in Change hander

3 Answers 176 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 11 Mar 2016, 08:18 PM

Is there a way to prevent default in the autocomplete change handler?

I don't want them to exit unless they type in a valid value from the data source. I tried e.preventDefault() but it doesn't seem to work.

 

 

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 14 Mar 2016, 08:12 AM
Hello Bob,

I am not really sure that I understand this request. Can you please elaborate a bit more?


Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bob
Top achievements
Rank 1
answered on 14 Mar 2016, 02:01 PM

Basically, if the user types an invalid value into the auto complete, I don't want focus to move to a new field, in other words, prevent the default action that caused the change to fire (selecting or typing in a value)

 

0
Accepted
Kiril Nikolov
Telerik team
answered on 16 Mar 2016, 09:10 AM
Hello Bob,

You can use the blur event of the input if you want to restrict the user movement, however there is no built-in mechanism for handling such behavior of the widget. 

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
AutoComplete
Asked by
Bob
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Bob
Top achievements
Rank 1
Share this question
or