중복실행 방지 스크립트 중복 submit

· 15년 전 · 6142 · 2
function init(){


document.getElementById("proc").attachEvent("onload",iframeOnload);
}
function iframeOnload(){

//처음 초기값 null! 이걸로 중복방지
document.regiFrm.enterFlag.value='';
}
function enterKeyEvent(){ //엔터키 이벤트
if(event.keyCode ==13){
onclickBtnSearch();
event.returnValue=false;
}
}
function onclickBtnSearch(){
var frm =document.regiFrm; //해당 폼

//중복실행방지

if(frm.enterFlag.value){
return;
}



/**

이부분은 해당 폼 실행하기 전에 체크할것

*/



frm.enterFlag.value='ing'; //ing값을 주어서
f.submit(); //고고싱

}



<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onload="init()">

<form name="regiFrm" action="cat_save.jsp" method="post">

//~해당소스



//inputbox 안에서 엔터키 부분

<input type="text" name="category_name" maxlength="50" value="<%=strCategoryName%>" onKeyDown="if(event.keyCode==13){javascript:enterKeyEvent();return false;}" style="border : 1 solid #6b6b6b; width:220px; height:20px" tabindex="1" onKeypress="javascript:codeCheck(event)"/>



//버튼부분

<img src="<%=strLangPath%>/img1/btn_ins04.gif" hspace="2" style="cursor:hand" onClick="javascript:onclickBtnSearch();" tabindex="2" />



//해당하는 폼안에 iframe작성

<iframe name="proc" id="proc" style="width:0;height:0"></iframe>

</form><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
|

댓글 2개

와 정말 좋네요~잘쓸게요
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
15년 전 조회 1,097
15년 전 조회 1,050
15년 전 조회 1,215
15년 전 조회 1,069
15년 전 조회 885
15년 전 조회 1,039
15년 전 조회 901
15년 전 조회 1,135
15년 전 조회 665
15년 전 조회 1,056
15년 전 조회 1,063
15년 전 조회 1,005
15년 전 조회 935
15년 전 조회 1,271
15년 전 조회 996
15년 전 조회 938
15년 전 조회 968
15년 전 조회 918
15년 전 조회 916
15년 전 조회 994
15년 전 조회 1,379
15년 전 조회 770
15년 전 조회 831
15년 전 조회 989
15년 전 조회 1,001
15년 전 조회 854
15년 전 조회 1,440
15년 전 조회 956
15년 전 조회 1,179
15년 전 조회 1,573
15년 전 조회 1,061
15년 전 조회 1,073
15년 전 조회 985
15년 전 조회 927
15년 전 조회 1,274
15년 전 조회 1,018
15년 전 조회 903
15년 전 조회 1,282
15년 전 조회 2,442
15년 전 조회 1,016
15년 전 조회 1,153
15년 전 조회 1,270
15년 전 조회 985
15년 전 조회 1,047
15년 전 조회 1,086
15년 전 조회 968
15년 전 조회 1,054
15년 전 조회 2,542
15년 전 조회 1,854
15년 전 조회 6,143
15년 전 조회 1,392
15년 전 조회 1,664
15년 전 조회 2,030
15년 전 조회 3,751
15년 전 조회 3,079
15년 전 조회 2,160
15년 전 조회 1,667
15년 전 조회 4,121
15년 전 조회 1,199
15년 전 조회 969
15년 전 조회 1,144
15년 전 조회 1,082
15년 전 조회 1,071
15년 전 조회 1,050
15년 전 조회 1,014
15년 전 조회 1,137
15년 전 조회 948
15년 전 조회 938
15년 전 조회 814
15년 전 조회 4,577
15년 전 조회 1,040
15년 전 조회 752
15년 전 조회 1,160
15년 전 조회 1,142
15년 전 조회 1,267
15년 전 조회 928
15년 전 조회 1,065
15년 전 조회 1,044
15년 전 조회 1,011
15년 전 조회 893
15년 전 조회 951
15년 전 조회 1,077
15년 전 조회 880
15년 전 조회 884
15년 전 조회 917
15년 전 조회 894
15년 전 조회 868
15년 전 조회 877
15년 전 조회 876
15년 전 조회 891
15년 전 조회 851
15년 전 조회 853
15년 전 조회 827
15년 전 조회 1,041
15년 전 조회 980
15년 전 조회 842
15년 전 조회 861
15년 전 조회 788
15년 전 조회 1,968
15년 전 조회 1,006