summaryrefslogtreecommitdiff
path: root/httemplate/elements/fckeditor/editor/dialog/common/fcknumericfield.htc
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/fckeditor/editor/dialog/common/fcknumericfield.htc')
-rw-r--r--httemplate/elements/fckeditor/editor/dialog/common/fcknumericfield.htc24
1 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/elements/fckeditor/editor/dialog/common/fcknumericfield.htc b/httemplate/elements/fckeditor/editor/dialog/common/fcknumericfield.htc
new file mode 100644
index 0000000..74f26d0
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/dialog/common/fcknumericfield.htc
@@ -0,0 +1,24 @@
+<public:component lightweight="true">
+
+<script language="javascript">
+
+function CheckIsDigit()
+{
+ var iCode = event.keyCode ;
+
+ event.returnValue =
+ (
+ ( iCode >= 48 && iCode <= 57 ) // Numbers
+ || (iCode >= 37 && iCode <= 40) // Arrows
+ || iCode == 8 // Backspace
+ || iCode == 46 // Delete
+ ) ;
+
+ return event.returnValue ;
+}
+
+this.onkeypress = CheckIsDigit ;
+
+</script>
+
+</public:component>