--------------------------------------------------- 2345王牌技术员联盟、2345王牌技术员联盟、期待与您交流!---------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MoneyBox.aspx.cs" Inherits="MoneyBox" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>金额文本框</title>
<script type="text/javascript">
function numKeyDown(){
var k=window.event.keyCode;
return isValid(k);
}
function isValid(k){
return((k==9)||(k==13)||(k==46)||(k==8)||(k==110)||(k==190)||(k==189)||(k==109)||(k>=37&&k<=40)||(k>=48&&k<=57)||(k>=96&&k<=105));
}
function numPaste(){
var data=clipboardData.getData('Text');
for(var i=0;i<=data.length;i++){
var num=data.charCodeAt(i);
if(!isValid(num))
{
return false;
}
}
}
function commafy(n){
var re=/\d{1,3}(?=(\d{3})+$)/g;
var n1=n.replace(/^(\d+)((\.\d+)?)+$/g,function (s,s1,s2){return s1.replace(re,"$&,")+s2;});
return n1;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="text" style="ime-mode:disabled;" />
</div>
</form>
</body>
</html>
--------------------------------------------------- 2345王牌技术员联盟、2345王牌技术员联盟、期待与您交流!---------------------------------------------------------