ajax - How can I submit a form on Enter key press without using jquery/javascript? -


the background question want use asp.net mvc5 create ms excel spreadsheet presentation in html table. excel features not part of this, & feel. pertaining features of excel want include in web page user entering values text boxes within table row. edit row, click on , turns table cells cells inputs/text boxes. enter data , press enter (no links , no buttons) , data saved database. input boxes removed , data put in cells.

i've started on project , have working find myself using 50% javascript/jquery/html. concern i'm using ajax/javascript/jquery when simplify design leveraging asp.net mvc.

i'm using ajax send data , data controller. callbacks use jquery create, update, delete rows in table changing edit mode () read mode ()

because use jquery ajax calls controller, of client code handling crud in table done via jquery. mvc designed in such way use beginform in cshtml template , send data inputs in table controller using formcollection parameter on press of enter key without using jquery?

you may able away adding submit button form after inputs, , using css set position absolute, , left or top properties large negative values, making submit button invisible while retaining it's default behavior of capturing enter key presses within form.

on other hand, wouldn't worry using javascript unless seeing actual performance or maintainability issue addressing. javascript straight forward way in opinion, , doesn't appear have significant performance penalty.


Comments