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 1036855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:46:20+00:00 2026-05-16T14:46:20+00:00

Hi everyone i have a problem like this. For example im in http://localhost/Search.aspx I

  • 0

Hi everyone i have a problem like this.

For example im in http://localhost/Search.aspx
I have 2 textboxes (txtUserName and txtPassword) in my page for login.
user can press enter key to call Login() method when any of these textboxes focused.
I capture enter key like this

txtUserName.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {Login();return false;}} else {return true}; ");
txtPassword.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {Login();return false;}} else {return true}; ");

Its calling the Login() method, and After doing that method Opera redirects the page to my default page (http://localhost/Default.aspx)

Other browsers is working as it should, in other words they are not redirect me to the default page.

Opera version 10.61

  • 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-05-16T14:46:20+00:00Added an answer on May 16, 2026 at 2:46 pm

    Alright, so you’re problem here is Opera (bless it) doesn’t support the onKeyDown command very well – so you have to look at onKeyUp or onKeyPress instead. There’s a really handy HTML table on quirksmode explaining this.

    Given you’re only trying to trap a control key onKeyUp is probably your best bet. I’ve been forced to combine onKeyDown and onKeyPress in order to catch text input AND control keys (but since you want text input to work as normal you don’t need to go this far).

    It should be simply a matter of switching “onkeydown” to “onkeyup” in your example fragment.

    There is, perhaps, a question of why you’d be doing the above. I don’t know what Login() does, but building a form with 3 parts (input-text, input-password, and input-submit button) will -by default- submit the form when enter is pressed in either of the input boxes, you could just add an onSubmit event to the form calling Login();

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

Sidebar

Related Questions

Hello again everyone, This time I have a problem with Intent & Extras. here's
Hello everyone I have a problem. I want to do a GridView with a
Good day everyone! I have a problem regarding my date. It needs to be
Hi everyone my problem today is I have a couple of buttons that slide
Salutations everyone, I have a somewhat strange problem with my repo. Initial I only
Good day everyone. I have been having the same problem all day at work
hey everyone, here is the site SEE BELOW I have a slight jquery problem
This problem smells like there should be an answer in graph theory, but it
I would like to know how you normally deal with this situation: I have
This is some background to my problem... I have been using 3rd Party as

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.