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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:24:48+00:00 2026-05-23T14:24:48+00:00

I have an iPad webapp with a big <form> at some point. Every input

  • 0

I have an iPad webapp with a big <form> at some point. Every input in it has functions controlling the values, both on keyUp and Blur events.

Thing is, if the user accidentaly hits the “GO” button while typing (considered as an “enter” keypress), the form is submitted. I would like to intercept this comportment and trigger the onBlur() event of the focused element instead.

For now I have this:

load(){
  document.addEventListener("keydown",logPressedKeys,false);
}
/**
 * logs the keys hit in the console, will eventually trigger my onBlur event
 */
  function logPressedKeys(e) {
      console.log(e.keyCode);
      if (e.keyCode==13) {
      console.log('Enter spotted: prevent!');
      e.preventDefault();//Shall prevent submitting
      return false;//Hoping it prevents default if above fails
  }
}

Do you guys have any advice/idea/improvement about that?

Nota bene: There has to be at least one input focused for the iPad’s keyboard to pop.

  • 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-23T14:24:49+00:00Added an answer on May 23, 2026 at 2:24 pm

    Found out that document.activeElement works out in iPad’s Safari.

    function logPressedKeys(e) {
        console.log(e.keyCode);
        if (e.keyCode==13) {
          e.preventDefault();
          console.log('Enter spotted: prevent!');
          temp=document.activeElement;
          //console.log(temp);
          temp.onblur();
          return false;
    }
    return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has Anyone tried using PDF in iPad Application, using CGPDf functions. I have used
I wish to have a java-chat on the iphone / ipad. With both, as
I have an ipad app, that as user does some actions, uitextfields and buttons,
I have contemplating how to handle paper document input in Webapps for some time.
I am developing a webapp for ipad and have come across an issue using
I have an iPad app which is for both iOS 4 and iOS 5.
I have ipad application which has 3 tableviews with holds data like label,image,property lists
i've installed new sdk 3.2 pre-release wich have iPad simulator, i have tried to
I have an iPad application that pulls in all of its data from an
I have a few labels on my first Ipad App. How to make them

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.