sms5 form전송시 두번 등록되는 오류 현상 수정

This commit is contained in:
thisgun
2014-06-02 13:12:14 +09:00
parent e29e972bf1
commit 241613d5cf

View File

@ -24,7 +24,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
</div> </div>
<div id="send_write"> <div id="send_write">
<form name="form_sms" id="form_sms" method="post" action="sms_write_send.php" onsubmit="return send(this);" > <form name="form_sms" id="form_sms" method="post" action="sms_write_send.php" onsubmit="return sms5_chk_send(this);" >
<input type="hidden" name="send_list" value=""> <input type="hidden" name="send_list" value="">
<h2>보낼내용</h2> <h2>보낼내용</h2>
@ -230,8 +230,11 @@ function overlap_check()
})(jQuery); })(jQuery);
} }
function send(f) var is_sms5_submitted = false; //중복 submit방지
function sms5_chk_send(f)
{ {
if( is_sms5_submitted == false ){
is_sms5_submitted = true;
var hp_list = document.getElementById('hp_list'); var hp_list = document.getElementById('hp_list');
var wr_message = document.getElementById('wr_message'); var wr_message = document.getElementById('wr_message');
var hp_number = document.getElementById('hp_number'); var hp_number = document.getElementById('hp_number');
@ -240,12 +243,14 @@ function send(f)
if (!wr_message.value) { if (!wr_message.value) {
alert('메세지를 입력해주세요.'); alert('메세지를 입력해주세요.');
wr_message.focus(); wr_message.focus();
is_sms5_submitted = false;
return false; return false;
} }
if (hp_list.length < 1) { if (hp_list.length < 1) {
alert('받는 사람을 입력해주세요.'); alert('받는 사람을 입력해주세요.');
hp_number.focus(); hp_number.focus();
is_sms5_submitted = false;
return false; return false;
} }
@ -257,11 +262,11 @@ function send(f)
act = window.open('sms_ing.php', 'act', 'width=300, height=200, left=' + w + ', top=' + h); act = window.open('sms_ing.php', 'act', 'width=300, height=200, left=' + w + ', top=' + h);
act.focus(); act.focus();
f.target = '';
f.action = 'sms_write_send.php';
f.send_list.value = list; f.send_list.value = list;
f.submit();
return true; return true;
} else {
alert("데이터 전송중입니다.");
}
} }
function hp_add() function hp_add()
@ -645,6 +650,9 @@ var sms_obj={
} }
}; };
(function($){ (function($){
$("#form_sms input[type=text], #form_sms select, #form_sms textare").keypress(function(e){
return e.keyCode != 13;
});
sms_obj.fn_paging = function( hash_val,total_page,$el,$search_form ){ sms_obj.fn_paging = function( hash_val,total_page,$el,$search_form ){
$el.paging({ $el.paging({
current:hash_val ? hash_val : 1, current:hash_val ? hash_val : 1,