RadarURL

회원가입 대상별 가입항목 다르게 처리하기

by 똑띠 posted Dec 14, 2009
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄

회원가입을 받다보면 가입대상에 따라 입력받아야할 항목들이 다를수가 있다.

 

여기에선 샘플로 일반회원/기업회원을 구분해서 가입을 따로 받는것을 설명해 본다.

 

우선 가입폼에서 두가지를 체크를 해보자.

 

회원가입동의체크 후 가입이 진행되는것이랑 회원 구분을 선택한뒤 가입을 진행하는것 두가지.

 

./modules/member/skins/default/signup_form.html 파일을 소개한다.

----------------------------------------------

 
<!--%import("../../tpl/js/signup_check.js")-->
<!--%import("../../tpl/js/krzip_search.js")-->
<!--%import("filter/signup.xml")-->
<!--// datepicker javascript plugin load -->
<!--%load_js_plugin("ui.datepicker")-->
<!--#include("./common_header.html")-->
<script  type="text/javascript">
<!--
 function check_agree() {

 num_temp = document.all.memberdiv.length; 
 for (i=0;i<num_temp ;i++) 
 { 
  if (document.all.memberdiv[i].checked == true) 
  { 
 if (document.all.memberdiv[1].checked == true){
 document.getElementById('agree_Box2').style.display = "";
 }
  break; 
  } 
 } 
 if (document.getElementById('accept_agree').checked == false || i == num_temp)
  {
   alert("개인취급방침동의 및 회원구분을 선택하셔야 가입됩니다.");
  } 
  else {
 document.getElementById('agree_Box').style.display = "none";
 document.getElementById('signup_Box').style.display = "";
 document.getElementById('signup_Box2').style.display = "";
  }

 }
-->
</script>
    <h3>{$lang->cmd_signup}</h3>
    <form id="fo_insert_member" action="/" method="get" onsubmit="return procFilter(this, signup)">
    <input type="hidden" name="mid" value="{$mid}" />
    <input type="hidden" name="document_srl" value="{$document_srl}" />
    <input type="hidden" name="page" value="{$page}" />
 <!--@if(!$is_logged && $member_config->agreement)-->
 <div id="agree_Box">
 <div class="agreementBox">
 {nl2br($member_config->agreement)}
 </div>
 <div class="agreementButton">
 <input type="checkbox" id="accept_agree" name="accept_agreement" value="Y" id="accept_agree" />
 <label for="accept_agree">{$lang->about_accept_agreement}</label>
 </div>
 <div>
 <span> 회원 구분을 선택해주세요</span>
 <input type="radio" name="memberdiv" value="일반회원" id="accept_agree2" >일반
 <input type="radio" name="memberdiv" value="기업회원" id="accept_agree2" >기업</p>
 </div>
 <div style="position:relative;text-align:center;"><a href="/javascript:check_agree();" class="button"><span> 다음 </span></a> &nbsp;  <a href="/{getUrl("act','','member_srl','')}" class="button"><span>{$lang->cmd_cancel}</span></a></div>  
 </div>
 <!--@end-->
 <div id="signup_Box" <!--@if(!$is_logged && $member_config->agreement)-->style="display:none;"<!--@end-->>
    <table cellspacing="0" class="rowTable">
    <tr>
        <th colspan="2" class="title"><div>{$lang->member_default_info}</div></th>
    </tr>
    <tr>
        <th><div>{$lang->user_id} <span class="require">*</span></div></th>
        <td class="wide"><input type="text" name="user_id" value="" class="inputTypeText"/> <p>{$lang->about_user_id}</p> </td>
    </tr>
    <tr>
        <th><div>{$lang->password} <span class="require">*</span></div></th>
        <td><input type="password" name="password1" value="" class="inputTypeText"/><p>{$lang->about_password}</p></td>
    </tr>
    <tr>
        <th><div>{$lang->password2} <span class="require">*</span></div></th>
        <td><input type="password" name="password2" value="" class="inputTypeText"/></td>
    </tr>
    <tr>
        <th><div>{$lang->user_name} <span class="require">*</span></div></th>
        <td>
            <input type="text" name="user_name" value="" class="inputTypeText"/><p>{$lang->about_user_name}</p>
        </td>
    </tr>
    <tr>
        <th><div>{$lang->nick_name} <span class="require">*</span></div></th>
        <td>
            <input type="text" name="nick_name" value="" class="inputTypeText"/><p>{$lang->about_nick_name}</p>
        </td>
    </tr>
    <tr>
        <th><div>{$lang->email_address} <span class="require">*</span></div></th>
        <td>
            <input type="text" name="email_address" value="" class="inputTypeText"/><p>{$lang->about_email_address}</p>
        </td>
    </tr>
    <tr>
        <th><div>{$lang->allow_mailing}</div></th>
        <td><input type="checkbox" class="checkbox" name="allow_mailing" value="Y" checked="checked" /> <p>{$lang->about_allow_mailing}</p></td>
    </tr>
 <tr>
        <th><div>휴대폰/연락처</div></th>
        <td>
   <input type="text" name="phone" value="{htmlspecialchars($val->value[0])}" size="4" class="inputTypeText" />
   <input type="text" name="phone" value="{htmlspecialchars($val->value[1])}" size="4" class="inputTypeText" />
   <input type="text" name="phone" value="{htmlspecialchars($val->value[2])}" size="4" class="inputTypeText" />
  </td>
    </tr>
 <tr>
        <th><div>자택/직장주소</div></th>
        <td>
   <div class="krZip">
    <div id="zone_address_1_address" style="display:<!--@if($val->value[0])-->inline<!--@else-->none<!--@end-->;">
     <input type="text" name="address" value="{$val->value[0]}" class="inputTypeText w400"/>
     <a href="/#" onclick="doHideKrZipList('address'); return false;" class="button"><span>{$lang->cmd_cancel}</span></a>
    </div>
    <div id="zone_address_list_address" style="display:none">
     <select name="_tmp_address_list_address" class="w300"></select>
     <a href="/#" onclick="doSelectKrZip('address'); return false;" class="button"><span>{$lang->cmd_select}</span></a>
     <a href="/#" onclick="doHideKrZipList('address'); return false;" class="button"><span>{$lang->cmd_cancel}</span></a>
    </div>
    <div id="zone_address_search_address" style="display:<!--@if($val->value[0])-->none<!--@else-->inline<!--@end-->;">
     <input type="text" name="_tmp_address_search_address" class="inputTypeText w400" value="" />
     <a href="/#" onclick="doSearchKrZip('address'); return false;" class="button"><span>{$lang->cmd_search}</span></a>
    </div>
    <div class="address2">
     <input type="text" name="address" value="{htmlspecialchars($val->value[1])}" class="inputTypeText w400" />
    </div>
   </div>
  </td>
    </tr>
 <tr>
        <th><div>우편물수령처</div></th>
        <td>
   <div class="krZip">
    <div id="zone_address_1_paddress" style="display:<!--@if($val->value[0])-->inline<!--@else-->none<!--@end-->;">
     <input type="text" name="paddress" value="{$val->value[0]}" class="inputTypeText w400"/>
     <a href="/#" onclick="doHideKrZipList('paddress'); return false;" class="button"><span>{$lang->cmd_cancel}</span></a>
    </div>
    <div id="zone_address_list_paddress" style="display:none">
     <select name="_tmp_address_list_paddress" class="w300"></select>
     <a href="/#" onclick="doSelectKrZip('paddress'); return false;" class="button"><span>{$lang->cmd_select}</span></a>
     <a href="/#" onclick="doHideKrZipList('paddress'); return false;" class="button"><span>{$lang->cmd_cancel}</span></a>
    </div>
    <div id="zone_address_search_paddress" style="display:<!--@if($val->value[0])-->none<!--@else-->inline<!--@end-->;">
     <input type="text" name="_tmp_address_search_paddress" class="inputTypeText w400" value="" />
     <a href="/#" onclick="doSearchKrZip('paddress'); return false;" class="button"><span>{$lang->cmd_search}</span></a>
    </div>
    <div class="address2">
     <input type="text" name="paddress" value="{htmlspecialchars($val->value[1])}" class="inputTypeText w400" />
    </div>
   </div>
  </td>
    </tr>
    </table>
 </div>
 <div id="agree_Box2" <!--@if(!$is_logged)-->style="display:none;"<!--@end-->>
 <div style="padding:10px 0px 5px 0px;"><span><li>기업회원 추가정보 입력</li></span></div>
 <table class="rowTable">
 <tr>
 <th><div><span>기업명</span></div></th>
 <td class="wide">
 <input type="text" name="company" value="{htmlspecialchars($val->value)}" class="inputTypeText w400" />
 </td>
 </tr>
 <tr>
 <th>대표자</th>
 <td>
 <input type="text" name="ceo" value="{htmlspecialchars($val->value)}" class="inputTypeText w400" />
 </td>
 </tr>
 <tr>
 <th><div><span>사업자등록번호</span></div></th>
 <td>
 <input type="text" name="codecheck" value="{htmlspecialchars($val->value)}" class="inputTypeText w400" />
 </td>
 </tr>
 </table>
 </div>
 <div id="signup_Box2" <!--@if(!$is_logged && $member_config->agreement)-->style="display:none;"<!--@end-->>
 <div style='text-align:center;'>
 <span class="button black strong"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
    <a href="/{getUrl("act','','member_srl','')}" class="button"><span>{$lang->cmd_cancel}</span></a>
 </div>
 </div>
</form>
<script type="text/javascript">
(function($){
    $(function(){
        var option = { changeMonth: true, changeYear: true, gotoCurrent: false,yearRange:'-100:+10', onSelect:function(){
            $(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))}
        };
        $.extend(option,$.datepicker.regional['{$lang_type}']);
        $(".inputDate").datepicker(option);
    });
})(jQuery);
</script>
<!--#include("./common_footer.html")-->