<SCRIPT LANGUAGE="JavaScript">
<!--
function Format_Comma(f){
str = f.value;
if(str == ""){
return;
} else {
var newValue = str + "";
var len = newValue.length;
var ch = "";
var j = 1;
var formatValue = "";
len = newValue.length;
for (i = len; i>0; i--){
ch = newValue.substring(i-1, i);
formatValue = ch + formatValue;
if((j % 3) == 0 && i > 1) {
formatValue = "," + formatValue;
}
j++;
}
}
f.value = formatValue;
}
function Delete_Comma(f){
str = f.value;
if(str == ""){
return;
} else {
var result = ""
comma_pattern = /([\,]{1})/;
for(var i = 0; i < str.length; i++) {
if(comma_pattern.test(str.charAt(i))) {
result += str.charAt(i).replace(comma_pattern, "");
} else {
result += str.charAt(i);
}
}
}
f.value = result;
}
function SetNum(obj){
val=obj.value;
re=/[^0-9]/gi;
obj.value=val.replace(re,"");
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<form name="form1">
<input type="text" name="price" size="15" maxlength="10" onkeypress="javascript:SetNum(this)" onblur="javascript:SetNum(this); Format_Comma(this)" onfocus="javascript:Delete_Comma(this)">
</form>
번호 | 제목 | 날짜 | 조회 수 |
---|---|---|---|
9 | Mysql Mysql 재시작 | ||
8 | Mysql 패스워드 변경시키기 | ||
7 | Mysql 여러 필드들의 평균 내기 | ||
6 | Mysql mysql에 csv 파일 밀어넣기 | ||
5 | Mysql DB자료 이전 | ||
4 | Mysql DB의 문자열을 한꺼번에 바꾸기 | ||
3 | Mysql 엑셀에서 셀을 탭으로 분리시 따옴표가 생기는 문제 | ||
2 | Mysql DB 전체 또는 특정 테이블 백업과 복원 | ||
1 | Mysql DB 내용 불러오기 |