How can I disable the enter key in the Editor ?

How can I disable the enter key in the Editor ?

hschneiderhschneider Posts: 2Questions: 1Answers: 0

Hi,

I have a Datatable with an Editor which pops up in a lightbox:

   var masterEditor = new $.fn.dataTable.Editor( {
        ajax: url_ajax,
        table: "#table_main",
        ...

How can I disable the enter key, so that it does now submit the form ?

I searched the forum, but all existing replies seem to deal with the inline editor, only.

Thank you very much,
Harald

Answers

  • hschneiderhschneider Posts: 2Questions: 1Answers: 0

    Sorry - the solution is:

    formOptions: {
                main: { submitOnReturn: false }
    }
    

    Hope this helps others as well.

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    A more consistent naming structure was introduce in 1.5: onReturn specifically (form-options). The submitOnReturn name is still supported for backwards compatibility though.

    Allan

This discussion has been closed.