function checkvalue() {
var r = document.register;
var total_value = 0;
total_value = r.price.value;
//--- replace는 한 개의 문자만 실행한다.
//--- 만약 , 가 두개가 있다면 두번을 실행해주어야한다.
total_value = total_value.replace(\',\',\'\');
total_value = total_value.replace(\',\',\'\');
total_value = total_value.replace(\',\',\'\');
// alert(total_value );
if (isNaN(total_value)) {
alert(\'숫자만 입력해 주십시오1.\');
//r.price.value = \"\";
r.price.focus();
}else{
if(total_value > 0) r.price.value = commaSplit(total_value);
}
}

function commaSplit(srcNumber) {
var txtNumber = \'\' + srcNumber;

var rxSplit = new RegExp(\'([0-9])([0-9][0-9][0-9][,.])\');
var arrNumber = txtNumber.split(\'.\');
arrNumber[0] += \'.\';
do {
arrNumber[0] = arrNumber[0].replace(rxSplit, \'$1,$2\');
} while (rxSplit.test(arrNumber[0]));
if (arrNumber.length > 1) {
return arrNumber.join(\'\');
}else{
return arrNumber[0].split(\'.\')[0];
}

}
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2005/04/20 09:32 2005/04/20 09:32
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/323

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/323

« Previous : 1 : ... 225 : 226 : 227 : 228 : 229 : 230 : 231 : 232 : 233 : ... 324 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/11   »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Statistics Graph

Site Stats

Total hits:
239810
Today:
462
Yesterday:
712