moz-bindings.xml 687 B

12345678910111213141516171819202122232425262728
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <bindings xmlns="http://www.mozilla.org/xbl">
  3. <binding id="numericfield">
  4. <implementation>
  5. <constructor>
  6. this.keypress = CheckIsDigit ;
  7. </constructor>
  8. <method name="CheckIsDigit">
  9. <body>
  10. var iCode = keyCode ;
  11. var bAccepted =
  12. (
  13. ( iCode >= 48 && iCode <= 57 ) // Numbers
  14. || (iCode >= 37 && iCode <= 40) // Arrows
  15. || iCode == 8 // Backspace
  16. || iCode == 46 // Delete
  17. ) ;
  18. return bAccepted ;
  19. </body>
  20. </method>
  21. </implementation>
  22. <events>
  23. <event type="keypress" value="CheckIsDigit()" />
  24. </events>
  25. </binding>
  26. </bindings>