Posted By

pablazo on 02/07/07


Tagged

javascript input forms keyevent


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

ironcrema
CesarChavezNava


solo numeros en campo de texto javascript


 / Published in: JavaScript
 

URL: http://www.cambiaresearch.com/c4/029c978b-aac5-472e-97a8-95b256f5febd/How-Can-I-Use-Javascript-to-Allow-Only-Numbers-to-Be-Entered-in-a-TextBox.aspx

  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;
  10.  
  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  

Comments

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 http://domyhomeworkonline.net/do-my-java-homework.php 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 http://addprinterwindows10.com/ thanks for share this information,then learn more about.

Posted By: jessicagoldner on July 23, 2019

Hello. Also, I can add a https://topdissertations.com/ 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 https://prime-essay.net/personality-essay-example

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 https://essaysleader.com/comic-book-script-format-writing/

You need to login to post a comment.