Okay
  Public Ticket #2116391
Disable the Enter Key on forms
Closed

Comments

  •  1
    withlovingarms started the conversation

    When typing in Japanese, the user must hit the enter key to convert Japanese characters. In the pop-up form, however, this submits the data before the user is finished.
    So I would like to disable the enter key. I can't seem to do it using jQuery. Is there another way?

  •  472
    Isidora replied

    Hi withlovingarms,
    Thank you for your purchase.

    Yes, you can change some code in our plugin. In file wp-content/plugins/wpdatatables/assets/js/wpdatatables/wpdatatables.js areound line 918 you will find this

    $(document).on('keyup', tableDescription.selector + '_edit_dialog input', function (e) {
        if (e.which == 13) {
            $(tableDescription.selector + '_ok_edit_dialog').click();
        }
    });

    and you have to comment it like this:

    // $(document).on('keyup', tableDescription.selector + '_edit_dialog input', function (e) {
    //     if (e.which == 13) {
    //         $(tableDescription.selector + '_ok_edit_dialog').click();
    //     }
    // });

    Please turn off option Use minified wpDataTables Javascript on CUSTOM JS AND CSS tab in settings of plugin and clear browsers cache. If you are using server cache clear it as well.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables