Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:28:04+00:00 2026-06-08T00:28:04+00:00

I wanna submit the form when pressing down the enter key. C# <asp:LinkButton ID=LinkButton1

  • 0

I wanna submit the form when pressing down the enter key.

C#

<asp:LinkButton ID="LinkButton1"  runat="server" class="login-button" OnClick="btnLogin_Click" >Login</asp:LinkButton>

JS

$(document).on('keydown ', function(event) {
    var key = {
        submit: event.keycode || event.which
    };

    if (key.submit == 13) {

        document.getElementById('LinkButton1').click();

    }
});

Then, I get the error in chrome 18.

Object javascript:__doPostBack(‘LinkButton1’,”) has no method ‘click’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:28:05+00:00Added an answer on June 8, 2026 at 12:28 am

    This will do it:

    $(document).on('keydown', function(e) {
        if (e.which == 13)
            __doPostBack('LinkButton1','');
    });
    

    Fiddle

    This will call the function which is assigned to your login button’s onclick handler when you press the Enter key in your page.

    The problem you were facing is most likely because your .click() is a shorthand for .trigger('click') which is not very well supported cross-browser if the handler was assigned outside of jQuery.

    Also, looking through some answers, this seems to be the simplest way to do this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i wanna disable a submit button when onclick. im able to disable the button
Can we submit a form in ASP.NET with AjaxToolkit ? e.g: below in our
I have a login form but I wanna check if the fields are empty
I'm making a slide-down login-form that is submitted with the jQuery ajax.form plugin. The
Ajax form submit usability. when i submit the form i wanna diable the form
I wanna know how do I enable a disabled form text field on submit.
I am new to Ajax. i wanna submit a form through Ajax and save
i wanna keep last value of input box after submit and this is my
I wanna run selenium tests from TeamCity using Maven at Linux server without display.
I have a form which takes multiple inputs from user. Now I wanna show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.