일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- JDOM
- Google Map
- JSON
- tomcat
- ibsheet
- jQuery
- Ajax
- MySQL
- swingx
- 가우스
- sencha touch
- PLSQL
- jsr 296
- Spring
- 선택적조인
- appspresso
- Android
- Eclipse
- 전자정부프레임워크
- Struts
- phonegap
- dock
- iBATIS
- rowspan
- MFC
- oracle
- node.js
- GPS
- WebLogic
- PHP
Archives
- Today
- Total
Where The Streets Have No Name
숫자만 입력시키고 0으로 시작되는부분 삭제처리 본문
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
/* --- 숫자만 입력 가능 (onKeyDown 이벤트) --- */
function onlyNumberInput()
{
var code = window.event.keyCode;
if ((code > 34 && code < 41) || (code > 47 && code < 58) || (code > 95 && code < 106) || code == 8 || code == 9 || code == 13 || code == 46)
{
window.event.returnValue = true;
return;
}
window.event.returnValue = false;
}
/* --- 숫자만 리턴 --- */
function onlyNum(txt)
{
var tmp = parseInt(txt.value,10);
if( isNaN(tmp) ){
alert('숫자가 아닙니다. 다시 입력하세요');
txt.value = "";
txt.focus();
}else{
txt.value = tmp;
}
return;}
</SCRIPT>
</HEAD>
<BODY>
<input size="14" type="text" name="jumin" maxLength="14" onKeyDown="onlyNumberInput();" onBlur="onlyNum(this)">
</BODY>
</HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
/* --- 숫자만 입력 가능 (onKeyDown 이벤트) --- */
function onlyNumberInput()
{
var code = window.event.keyCode;
if ((code > 34 && code < 41) || (code > 47 && code < 58) || (code > 95 && code < 106) || code == 8 || code == 9 || code == 13 || code == 46)
{
window.event.returnValue = true;
return;
}
window.event.returnValue = false;
}
/* --- 숫자만 리턴 --- */
function onlyNum(txt)
{
var tmp = parseInt(txt.value,10);
if( isNaN(tmp) ){
alert('숫자가 아닙니다. 다시 입력하세요');
txt.value = "";
txt.focus();
}else{
txt.value = tmp;
}
return;}
</SCRIPT>
</HEAD>
<BODY>
<input size="14" type="text" name="jumin" maxLength="14" onKeyDown="onlyNumberInput();" onBlur="onlyNum(this)">
</BODY>
</HTML>