Prevent Default in Change hander

4 posts, 1 answers
  1. Bob
    Bob avatar
    138 posts
    Member since:
    Sep 2012

    Posted 11 Mar Link to this post

    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.

     

     

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 14 Mar Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Bob
    Bob avatar
    138 posts
    Member since:
    Sep 2012

    Posted 14 Mar in reply to Kiril Nikolov Link to this post

    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)

     

  5. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 16 Mar Link to this post

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