minlength 속성 체크하도록 wrest.js 수정
This commit is contained in:
@ -9,7 +9,7 @@ $token = get_token();
|
||||
if ($w == '')
|
||||
{
|
||||
$required_mb_id = 'required';
|
||||
$required_mb_id_class = 'required minlength=3 alnum_';
|
||||
$required_mb_id_class = 'required alnum_';
|
||||
$required_mb_password = 'required';
|
||||
$sound_only = '<strong class="sound_only">필수</strong>';
|
||||
|
||||
@ -154,7 +154,7 @@ include_once('./admin.head.php');
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_id">아이디<?php echo $sound_only ?></label></th>
|
||||
<td>
|
||||
<input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" maxlength="20" >
|
||||
<input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" minlength="3" maxlength="20">
|
||||
<?php if ($w=='u'){ ?><a href="./boardgroupmember_form.php?mb_id=<?php echo $mb['mb_id'] ?>">접근가능그룹보기</a><?php } ?>
|
||||
</td>
|
||||
<th scope="row"><label for="mb_password">비밀번호<?php echo $sound_only ?></label></th>
|
||||
@ -162,9 +162,9 @@ include_once('./admin.head.php');
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_name">이름(실명)<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input minlength=2" size="15" maxlength="20"></td>
|
||||
<td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input" size="15" minlength="2" maxlength="20"></td>
|
||||
<th scope="row"><label for="mb_nick">닉네임<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input minlength=2" size="15" maxlength="20"></td>
|
||||
<td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input" size="15" minlength="2" maxlength="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_level">회원 권한</label></th>
|
||||
|
||||
17
js/wrest.js
17
js/wrest.js
@ -204,15 +204,15 @@ function wrestAlNum_(fld)
|
||||
}
|
||||
|
||||
// 최소 길이 검사
|
||||
function wrestMinLength(fld, css)
|
||||
function wrestMinLength(fld)
|
||||
{
|
||||
if (!wrestTrim(fld)) return;
|
||||
|
||||
var str = css.split('='); // minlength=?? <-- str[1]
|
||||
var minlength = fld.getAttribute("minlength");
|
||||
|
||||
if (wrestFld == null) {
|
||||
if (fld.value.length < parseInt(str[1])) {
|
||||
wrestMsg = wrestItemname(fld) + " : 최소 "+str[1]+"글자 이상 입력하세요.\n";
|
||||
if (fld.value.length < parseInt(minlength)) {
|
||||
wrestMsg = wrestItemname(fld) + " : 최소 "+minlength+"글자 이상 입력하세요.\n";
|
||||
wrestFld = fld;
|
||||
}
|
||||
}
|
||||
@ -282,6 +282,10 @@ function wrestSubmit()
|
||||
wrestRequired(el);
|
||||
}
|
||||
|
||||
if (el.getAttribute("minlength") != null) {
|
||||
wrestMinLength(el);
|
||||
}
|
||||
|
||||
var array_css = el.className.split(" "); // class 를 공백으로 나눔
|
||||
|
||||
el.style.backgroundColor = wrestFldDefaultColor;
|
||||
@ -305,10 +309,7 @@ function wrestSubmit()
|
||||
case "telnum" : wrestTelNum(el); break; // 김선용 2006.3 - 전화번호 형식 검사
|
||||
case "imgext" : wrestImgExt(el); break;
|
||||
default :
|
||||
// css 가 minlength= 로 시작한다면 = 뒤의 숫자는 최소길이값
|
||||
if (/^minlength\=/.test(css)) {
|
||||
wrestMinLength(el, css); break;
|
||||
} else if (/^extension\=/.test(css)) {
|
||||
if (/^extension\=/.test(css)) {
|
||||
wrestExtension(el, css); break;
|
||||
}
|
||||
} // switch (css)
|
||||
|
||||
@ -32,17 +32,17 @@ $juso_addr3_view = $member['mb_addr_jibeon'] == 'N' ? 'style="display:none"' : '
|
||||
<th scope="row"><label for="reg_mb_id">아이디<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<span class="frm_info">영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요.</span>
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" class="frm_input minlength=3 <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20" <?php echo $required ?> <?php echo $readonly ?>>
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" class="frm_input <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20" <?php echo $required ?> <?php echo $readonly ?>>
|
||||
<span id="msg_mb_id"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password">비밀번호<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" class="frm_input minlength=3 <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" class="frm_input <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password_re">비밀번호 확인<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" class="frm_input minlength=3 <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" class="frm_input <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -35,17 +35,17 @@ $juso_addr3_view = $member['mb_addr_jibeon'] == 'N' ? 'style="display:none"' : '
|
||||
<th scope="row"><label for="reg_mb_id">아이디<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<span class="frm_info">영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요.</span>
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" <?php echo $required ?> <?php echo $readonly ?> class="frm_input minlength=3 <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20">
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" <?php echo $required ?> <?php echo $readonly ?> class="frm_input <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20">
|
||||
<span id="msg_mb_id"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password">비밀번호<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" <?php echo $required ?> class="frm_input minlength=3 <?php echo $required ?>" minlength="3" maxlength="20"></td>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" <?php echo $required ?> class="frm_input <?php echo $required ?>" minlength="3" maxlength="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password_re">비밀번호 확인<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" <?php echo $required ?> class="frm_input minlength=3 <?php echo $required ?>" minlength="3" maxlength="20"></td>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" <?php echo $required ?> class="frm_input <?php echo $required ?>" minlength="3" maxlength="20"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user