Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Triggering enter key on press on a fragment

Hi,

I want to trigger submit button on pressing enter key.

Above shown is the scenario where i want to trigger submit button on entery key press.

How do i do that?

Please suggest me ways to achieve it.

Thanks,

Saurabh Singh.

Tags:
replied

Hi Saurabh,

Will this help?

http://jsbin.com/winepe/edit?html,js,output

Use this in dialog:

  afterOpen : function(){

            $(document).bind('keypress', function(e) {

    if(e.keyCode==13){

    e.preventDefault();

            alert('Enter key Pressed');

   sap.ui.getCore().byId("idClose").firePress();

    }

  });

          }

Thanks,

KA

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question