You can ensure the same function gets called when all textboxes fire that event. Would it be possible to call such function through the onfocus handler of the particular textbox? TextBox1; if prevNum! Since you are calling keypad function on button click which means the button which is clicked has focus and not any textbox.
Wow, this is an old thread. For what it's worth, the easiest way to accomplish what you want is to set a boolean flag in the input's onfocus event handler, e. Now whenver you want to detect whether the input box is currently focused from within your function, just check against the boolean flag, e.
Hello I know this post has along time, but I just had the same error and I want to tell you how I fixed it. This line gets the current active element as an object, I used it in an if sentence but and it fixed my problem. I hope is useful to you as it was to me. The content you requested has been removed. Ask a question. Email Required, but never shown. The Overflow Blog. Podcast Explaining the semiconductor shortage, and how it might end. Does ES6 make JavaScript frameworks obsolete?
Featured on Meta. Now live: A fully responsive profile. Linked Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled. Your message has been sent to W3Schools. W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.
While using W3Schools, you agree to have read and accepted our terms of use , cookie and privacy policy.
0コメント