Your ROOT_URL in app.ini is http://git.zky.com/ but you are visiting http://61.178.84.89:8998/luoluo/zhky/src/commit/49ca98a68673f5c2a0737e0964a9a1651b8377a7/web/css/digitFormat.htc You should set ROOT_URL correctly, otherwise the web may not work correctly.
zhky/web/css/digitFormat.htc

38 lines
856 B

<public:component>
<public:attach event="onblur" onevent="itemOnBlur()" />
<public:attach event="onkeypress" onevent="keypress()" />
<public:attach event="onbeforepaste" onevent="beforePaste()" />
<public:method name="validate">
<script language="javascript">
function validate() {
if (element.value.length==0) return true;
var pat = /(^[1-9][0-9]+$)|(^[0-9]{1}$)/;
var ret = pat.exec(element.value);
if(!ret) {
alert("错误的阿拉伯数字格式!");
element.value="";
element.focus();
return false;
}
return true;
}
function itemOnBlur(){
validate();
}
//只能输入数字0-9
function keypress() {
if ( !((window.event.keyCode >= 48) && (window.event.keyCode <= 57)))
{
window.event.keyCode = 0 ;
}
}
function beforePaste() {
clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''));
}
</script>
</public:component>