how do I disable button submit on enter key press ?

Hi

I am trying to leave paragraph spaces in my textarea  by pressing enter in a custom InlineFormTemplate in the grid , when I press enter it submits (saves) the row, how do I disable this?


1 Reply

PS Pon Selva Jeganathan Syncfusion Team September 8, 2021 02:50 PM UTC

Hi Dwayne 
   
Thanks for contacting syncfusion forum. 

Query: how do I disable button submit on enter key press ?

 
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 use the keySettings property in grid. 
 
In this sample using keySettings property we can prevent the record save action while pressing enter key.  By overriding the value of SaveRequest a sub property of keySettings, you can prevent the saving Grid records while pressing enter key. The default value of the SaveRequest is “13” keycode for an enter key.   

Refer the below code example.  

   <ej:Grid runat='server' ClientIDMode="Static" ID="ReasonCodeGrid"  AllowPaging="true" > 
             
            
          < KeySettings SaveRequest="" / > 
           <ClientSideEvents ActionComplete ="complete" /> 
           <ToolbarSettings ShowToolbar="true" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> 
           <Columns> 
                ……. 
            </Columns> 
        </ej:Grid> 

Please refer to the below sample, 


Refer the help documentation.  

 
Kindly get back to us for further assistance.  

Regards, 
Pon selva 

 


Loader.
Up arrow icon