Forum Index

No notifications
Notifications

Favorites

No favorites found
Ask the community Need help to achieve something? - Ask the Community
Join the Conversation > Ask the community > JQuery cannot detect enter key View modes: 
User avatar
Advanced member
Advanced member
Arun Murthy - 05/12/2016 02:41:43
   
JQuery cannot detect enter key

Hi,

I not sure but the enter key cannot be detected by keypress. Below is the scripts and I add the style "kk_OnEnterSubmit" to a FreeText question type.

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args) {
    if (args.get_error() == undefined) {
        SetClientBindings();
    }                   
}

function SetClientBindings() {
    $(".kk_OnEnterSubmit").keypress(function (e) {
        if (e.which == 13) {
            alert("enter");
            $("#Form1").submit();
            /*return false;*/
          }
    });
}

SetClientBindings();


1 2 3
RSS Feed