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

how to prevent save when enter key pressed in the text field

Thread ID:





131495 Jul 13,2017 12:32 AM UTC Jul 13,2017 02:57 PM UTC ASP.NET MVC 1
Tags: Grid
Dongil Shin
Asked On July 13, 2017 12:32 AM UTC

Hi, I'm having a problem that preventing automatic save when enter key pressed in the text field.

the code I'm looking in as follows.

function CheckEnterKey() {
    if (event.which == 13) {        
        var s = $('.nextstepdetails').val();
        $('.nextstepdetails').val(s + "\n");

// Edit template functions for MultiLine textbox
function createML() {
    return "<textarea class='form-control nextstepdetails' rows='1' cols='50' style='word-wrap:break-word !important;' onkeydown='CheckEnterKey()' onkeypress='CheckEnterKey()'>{{:NextStepDetail}}</textarea>";

the text field is styled as textarea. I don't want autosave when 'Enter' key pressed. I want to keep editing the text and just click 'Save/Update' button to save.

Thank you in advance!
Kind Regards,

Thavasianand Sankaranarayanan [Syncfusion]
Replied On July 13, 2017 02:57 PM UTC

Hi Dongil, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we suspect that you want to prevent the Grid to save by clicking on the enter button in keyboard. So, we suggest you to set “allowKeyboardNavigation” as “false“ for ejGrid control. 

Refer the below code example. 

            .AllowKeyboardNavigation(false) // disable keyboard navigation of Grid 
 .Columns(col => 

We have prepared a sample and it can be downloadable from the below location. 

Refer the help documentation. 

If we misunderstood your query then please get back to us. 

Thavasianand S. 


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