묻고답하기
닉네임 길이를 제한하였습니다.
2013.03.26 12:21
길이를 초과해서 입력해서 가입 시도를 하면 단순 에러 메세지만 출력되고 가입창 초기로 돌아가기 때문에 방문자에게 안내를 해 줄 필요가 있을 것 같습니다.
현재 제가 사용하고 있는 멤버 스킨의 signup_form.html 의 코드 입니다. 닉네임 입력항목 옆에 안내문구를 넣어주고 싶습니다.
PC스킨
<load target="../../tpl/js/signup_check.js" />
<!--// datepicker javascript plugin load -->
<!--%load_js_plugin("ui")-->
<!--%load_js_plugin("ui.datepicker")-->
<include target="./common_header.html" />
<div id="border" style="width: 90%">
<h1 class="h1">{$lang->cmd_signup}</h1>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="@insertMember" id="fo_insert_member" class="form" action="./" method="post" enctype="multipart/form-data">
<input type="hidden" name="act" value="procMemberInsert" />
<div class="agreement" cond="$member_config->agreement">
<div class="text">
{$member_config->agreement}
</div>
<div class="confirm">
<input type="checkbox" name="accept_agreement" value="Y" id="accept_agree" />
<label for="accept_agree">{$lang->about_accept_agreement}</label>
</div>
</div>
<table>
<tr>
<th scope="row" id="signup_th">{$identifierForm->title} <em style="color:red">*</em></th>
<td id="signup">
<input type="text" name="{$identifierForm->name}" value="{$identifierForm->value}" />
</td>
</tr>
<tr>
<th scope="row" id="signup_th">{$lang->password} <em style="color:red">*</em></th>
<td id="signup"><input type="password" name="password" value=""/>
<span class="desc">{$lang->about_password}</span></td>
</tr>
<tr>
<th scope="row" id="signup_th">{$lang->password3} <em style="color:red">*</em></th>
<td id="signup">
<input type="password" name="password2" value=""/>
</td>
</tr>
<tr loop="$formTags=>$formTag" cond="$formTag->name != 'signature'">
<th scope="row" id="signup_th">{$formTag->title}</th>
<td id="signup">{$formTag->inputTag}</td>
</tr>
<tr>
<th scope="row" id="signup_th">{$lang->allow_mailing}</th>
<td id="signup">
<input type="radio" name="allow_mailing" id="mailingYes" value="Y" checked="checked"|cond="$member_info->allow_mailing == 'Y'||!$member_info->allow_mailing"> <label for="mailingYes">{$lang->cmd_yes}</label>
<input type="radio" name="allow_mailing" id="mailingNo" value="N" checked="checked"|cond="$member_info->allow_mailing == 'N'" > <label for="mailingNo">{$lang->cmd_no}</label>
</td>
</tr>
<tr>
<th scope="row" id="signup_th">{$lang->allow_message}</th>
<td id="signup">
<block loop="$lang->allow_message_type=>$key,$val">
<input type="radio" name="allow_message" value="{$key}" checked="checked"|cond="$member_info->allow_message == $key || (!$member_info && $key == 'Y')" id="allow_{$key}" /> <label for="allow_{$key}">{$val}</label>
</block>
</td>
</tr>
</table>
<div class="btnArea">
<span class="btn"><input type="submit" value="{$lang->cmd_registration}" /></span>
<span class="btn"><a href="{getUrl('act','','member_srl','')}">{$lang->cmd_cancel}</a></span>
</div>
</form>
</div>
<script type="text/javascript">
(function($){
$(function(){
var option = { changeMonth: true, changeYear: true, gotoCurrent: false,yearRange:'-100:+10', dateFormat:'yy-mm-dd', onSelect:function(){
$(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))}
};
$.extend(option,$.datepicker.regional['{$lang_type}']);
$(".inputDate").datepicker(option);
$(".dateRemover").click(function() {
$(this).prevAll('input').val('');
return false;});
});
})(jQuery);
</script>
<include target="./common_footer.html" />
member.admin.controller.php 에
}else if($formInfo->name == 'nick_name'){
$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:8" />', $formInfo->name);
코드를 삽입하여 닉네임 글자수 제한을 했습니다.