//숫자만 입력
function GetOnlyNumeric(ths){
var anum=/(^\d+$)|(^\d+\.\d+$)/
if (anum.test(ths.value) || ths.value == ""){}
else{
alert("숫자만 입력하세요.")
ths.value = ""
ths.focus();
}
}

function GetOnlyNumEng(ths){
var NumEng = /^[A-Za-z0-9]+$/;

if(NumEng.test(ths.value) || ths.value == ""){}
else{
alert("숫자와 영문자만 입력하세요.");
ths.value = "";
ths.focus();
}

}

//--- 한글은 2바이트로 그 외는 1바이트로 글자수 계산.( 한글만)
String.prototype.CalByteHN = function()
{
var self = this;

if (Boolean(self))
{
var strLen = self.length || 0;
var totByteHN = 0;

for (var i=0; i{
totByteHN += (4 < escape(self.charAt(i)).length)? 1 : 0;
}

return totByteHN;
}
}
//--- 한글은 2바이트로 그 외는 1바이트로 글자수 계산.( 한글외 )
String.prototype.CalByte = function()
{
var self = this;

if (Boolean(self))
{
var strLen = self.length || 0;
var totByte = 0;

for (var i=0; i{
totByte += (4 < escape(self.charAt(i)).length)? 2 : 1;
}

return totByte;
}
}

//--- 공백 제거
function ignoreSpaces(string){
var temp = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
temp += splitstring[i];
return temp;
}
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2009/01/15 16:31 2009/01/15 16:31
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/3884

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

« Previous : 1 : ... 2549 : 2550 : 2551 : 2552 : 2553 : 2554 : 2555 : 2556 : 2557 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/04   »
  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:
183119
Today:
508
Yesterday:
607