We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

For Auto complete control,whole form is submitting automatically when option is selected with enter key with keyboard navigation.

Thread ID:

Created:

Updated:

Platform:

Replies:

142370 Jan 30,2019 05:35 AM UTC Jan 31,2019 06:56 AM UTC Angular - EJ 2 3
loading
Tags: AutoComplete
Goutham
Asked On January 30, 2019 05:35 AM UTC

For Auto complete control,whole form is submitting automatically when option is selected with enter key with keyboard navigation.(not a problem with mouse navigation).

Prince Oliver [Syncfusion]
Replied On January 30, 2019 04:54 PM UTC

Hi Goutham, 

Thank you for contacting Syncfusion support. 

We have checked your reported scenario “autocomplete triggers form submitting automatically upon pressing enter key”. This is default form submit behavior, when enter key is pressed in input element. It will check the validation and submit the form. Please find the document for your reference. 


To prevent form submit when pressing the enter key, use the Autocomplete change event and check the event type and prevent the action. Please find the code snippet and sample for your reference. 

change: function(args) { 
    if (args.e && args.e.type === 'keydown' && (args.e as KeyboardEvent).keyCode === 13) { 
        args.e.preventDefault(); 
    } 
} 


Please let us know if you need any further assistance on this. 

Regards, 
Prince 


Goutham
Replied On January 31, 2019 06:52 AM UTC

Thank you,it is working as expected

Prince Oliver [Syncfusion]
Replied On January 31, 2019 06:56 AM UTC

Hi Goutham,  
 
Most Welcome, we are glad to help you.  
 
Regards,  
Prince  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;