To see how the script works, press Ctrl + q (an Alert - box pops up). In the event.keyCode = = part of the script you define which keyboard key has to be pressed in order to perform an action (17 is the keyCode for "Ctrl + q"). You can see a part of the keyCodes here (if you need the complete keyCode - table, order it by email). What should happen after the user hits the key is defined in the next line of code. If you put here, for instance, window.location="http://www.yahoo.geocities.com" instead of alert ('Example'), the visitor will be taken to the Geocities Homepage.
The ASCII key codes can be used with forms to determine what signs will be accepted in a certain field. The next script determines to accept only numbers into a field and no other signs:
|