$(function(){ initForm(document.gameRegform); $('#btn-game-reg').on('click', function(e){ /*if(isGameState){ if(!loginCheck()) return; // 로그인 여부 확인 $('#reg-game-wrap').height($(document).height()+160); $('#reg-game-wrap').toggle(); $('#reg-game-wrap .reg-game-container').css('margin-top', $(window).scrollTop()+150) }else{ if(isGameEnd == true){ alert('대회가 종료되었습니다.'); }else{ alert('참가신청이 마감되었습니다.'); } }*/ if(isGameEnd == true){ alert('대회가 종료되었습니다.'); }else{ if(!loginCheck()) return; // 로그인 여부 확인 if(isGameState == true || isPlayer == true){ $('#reg-game-wrap').height($(document).height()+160); $('#reg-game-wrap').toggle(); $('#reg-game-wrap .reg-game-container').css('margin-top', $(window).scrollTop()+150); }else{ alert('대회 접수가 마감되었습니다.'); } } e = e || window.event; (e.which)?e.preventDefault():e.returnValue = false; }); $('#btn-game-reg-cancel').on('click', function(){ $('#reg-game-wrap').toggle(); }); // 조편성 /*$('#btn-game-team').on('click', function(e){ e = e || window.event; (e.which)?e.preventDefault():e.returnValue = false; gameTabAlert('team'); });*/ // 참가신청 $('#btn-game-reg-ok').on('click', function(){ var arrName = []; var arrPhone = []; var arrSex = []; var i = 0; var isOK = true; // 로그인 여부 확인 //if(!loginCheck()) return; $('#reg-game-form li').each(function(){ var name = $(this).find('.name').val(); var phone = $(this).find('.phone').val(); var sex = $(this).find('.sex').val(); log('name:'+ name +', phone:'+ phone +', sex:'+ sex); if(name || phone || sex) { if(!name){ isOK = false; alert("이름을 입력하세요."); $(this).find('.name').focus(); return false; } if(!phone){ isOK = false; alert("핸드폰 번호를 입력하세요."); $(this).find('.phone').focus(); return false; } if(!sex){ isOK = false; alert("성별을 선택하세요."); $(this).find('.sex').focus(); return false; } arrName[i] = name; arrPhone[i] = phone; arrSex[i] = (sex == 'M')?'남':'여'; i++; } }); // end each if(isOK){ if(i == 0){ alert('신청자를 입력하세요'); return; } var msg = ''; for(i=0;i'); } }); });