|
|
|
อยากถามเกี่ยวกับการขึ้นคอมมร์อัตโนมัติ เมื่อขึ้นหลักพัน หมื่น หรือ แสน |
|
|
|
|
|
|
|
Code (PHP)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>https://www.thaicreate.com/php/forum/087166.html</title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="UnIdentifier">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<script>
$(document).ready(function(){
$('input.number').keyup(function(event){
if(event.which >= 37 && event.which <= 40){
event.preventDefault();
}
var $this = $(this);
var num = $this.val().replace(/,/gi, "").split("").reverse().join("");
var num2 = RemoveRougeChar(num.replace(/(.{3})/g,"$1,").split("").reverse().join(""));
$this.val(num2);
});
});
function RemoveRougeChar(convertString){
if(convertString.substring(0,1) == ","){
return convertString.substring(1, convertString.length)
}
return convertString;
}
</script>
</head>
<body>
<input type="text" class="number" />
</body>
</html>
|
|
|
|
|
Date :
2012-11-24 00:27:48 |
By :
sakuraei |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|