By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

Alert box popup with hidden input

P: 5
Hi,

I have a bit of a problem where I want to be able to type a word, for example 'SHOWIT' and I wan't an alert box to show with a message. Now when I say I want to type the word, I don't mean into an input box, I just want to type it 'on' the page and as soon as the word is complete the alert should show, so there is no need to press enter.

Example:

I am on example.com and I type 'SHOWIT' and an alert box pops up and displays a message.

Is this possible? I'm just learning the ropes of JS, although I am confident in HTML/CSS/PHP.

Any help or pointers appreciated.

Thanks in advance :-)
Oct 30 '11 #1
Share this Question
Share on Google+
2 Replies


100+
P: 1,059
I will give you a simple example, rest is upto you
Expand|Select|Wrap|Line Numbers
  1. <script language='JAVASCRIPT'>
  2. window.onkeypress= function (event)
  3. {
  4.     alert(event.keyCode);
  5. }
  6. </script>
Oct 31 '11 #2

P: 5
Hi,

Thanks for the hint - I think I am quite close now thanks to you :-)

Cheers
Nov 1 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.