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. Image for the cookie policy date
close icon

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

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).

3 Replies

PO Prince Oliver Syncfusion Team 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 



GO Goutham January 31, 2019 06:52 AM UTC

Thank you,it is working as expected


PO Prince Oliver Syncfusion Team January 31, 2019 06:56 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon