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/3fc79397d6b3e4c1865f210578f2d97f5aa17da1/out/artifacts/zhyw_war_exploded/css/currencyFormat.htc You should set ROOT_URL correctly, otherwise the web may not work correctly.
zhky/out/artifacts/zhyw_war_exploded/css/currencyFormat.htc

39 lines
985 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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 false;
var pat = /^(?:-|\+){0,1}\d+(?:\.\d{0,2}){0,1}$/;
var ret = pat.test(element.value);
if(!ret) {
alert("错误的货币格式!\n正确的格式小数点后最多保留两位");
element.value="";
element.focus();
return false;
}
return true;
}
function itemOnBlur(){
validate();
}
function keypress() {
if ( !((window.event.keyCode >= 48) && (window.event.keyCode <= 57)
|| window.event.keyCode==43 || window.event.keyCode==45 || window.event.keyCode==46))
{
window.event.keyCode = 0 ;
}
}
function beforePaste() {
clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''));
}
</script>
</public:component>