Posted By

pablazo on 02/07/07


javascript input forms keyevent

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


solo numeros en campo de texto javascript

 / Published in: JavaScript


  1. <HTML>
  2. <HEAD>
  3. <SCRIPT language=Javascript>
  4. <!--
  5. function isNumberKey(evt)
  6. {
  7. var charCode = (evt.which) ? evt.which : event.keyCode
  8. if (charCode > 31 && (charCode < 48 || charCode > 57))
  9. return false;
  11. return true;
  12. }
  13. //-->
  14. </SCRIPT>
  15. </HEAD>
  16. <BODY>
  17. <INPUT id="txtChar" onkeypress="return isNumberKey(event)" type="text" name="txtChar">
  18. </BODY>
  19. </HTML>

Report this snippet  


RSS Icon Subscribe to comments
Posted By: eloisecardwell on March 26, 2018

Many teachers care a ton about their urban students and stick around along with to teach programming.

Posted By: martingarix on March 12, 2019

If you want to add new printer windows 10,just one a single click here this url link thanks for share this information,then learn more about.

Posted By: jessicagoldner on July 23, 2019

Hello. Also, I can add a to your list of useful links. This is a reliable writing service. Only professional writers and editors work here. I can for sure recommend it for you.

Posted By: deniseandams on August 14, 2019

A personality essay means you will have to tell a lot about yourself but you need to make this essay inspiring. If you wand to make it astoishing, you may cosult the following quideline and even read a sample of this essay here

Posted By: samcarter on September 11, 2019

Specific feature of comic writing is that it requires drawing. It is not only about writing a good plot but also about visual presentation of your heroes. If you do not know how to become a comic book writer, you should remember that it requires two components: writing and drawing skills

You need to login to post a comment.