block key press




JavaScript Source Code 3000: Forms: Block Key Press






























Block Key Press







(Internet Explorer Only) Using the OnKeypress event, you can trap and prevent certain characters (repesented by ASCII decimal codes) from being entered in a form
field. Just look up the ASCII code for any other characters you wish to block and add it to the script. Unfortunately, Netscape does not support this same functionality.








This field will not accept special characters: (like !@#$%^&* etc)



This field will not accept double or single quotes:



This field will only accept numbers:







JavaScript Source Code 3000: Forms: Block Key Press
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!





    





<!-- ONE STEP TO INSTALL BLOCK KEY PRESS:

1. Copy the coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

<BODY>

<!-- Script by: Jeremy Wollard (wollard@flash.net) -->

<center>
<form onSubmit="return false;">
This field will not accept special characters: (like !@#$%^&* etc)<br>
<textarea rows=2 cols=20 name=comments onKeypress="if ((event.keyCode > 32 && event.keyCode < 48) || (event.keyCode > 57 && event.keyCode < 65) || (event.keyCode > 90 && event.keyCode < 97)) event.returnValue = false;"></textarea>
<br>
<br>
This field will not accept double or single quotes:<br>
<input type=text name=txtEmail onKeypress="if (event.keyCode==34 || event.keyCode==39) event.returnValue = false;">
<br>
<br>
This field will only accept numbers:<br>
<input type=text name=txtPostalCode onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
</form>
</center>



<!-- Script Size: 0.99 KB -->











Wyszukiwarka

Podobne podstrony:
key press
function mcrypt module get algo key size
answer key
action=produkty wyswietl&todo=koszyk&produkt=12&key=
action=produkty wyswietl&todo=koszyk&produkt=71&key=
English for Medical S&D Practical English sentences key
action=produkty wyswietl&todo=koszyk&produkt=61&key=
Cisco Press CCNP Routing Exam Certification Guide Appendix
action=produkty wyswietl&todo=koszyk&produkt=27&key=
Key Skills 3
action=produkty wyswietl&todo=koszyk&produkt=126&key=
42 key

więcej podobnych podstron