#282 에 따른 처리: required 스타일 js를 css 로 변경

This commit is contained in:
whitedot
2013-02-20 13:30:21 +09:00
parent 53aa6afc17
commit 6e7d436d88
4 changed files with 12 additions and 23 deletions

View File

@ -130,11 +130,15 @@ fieldset .btn_submit:focus {height:21px;background:#555;line-height:1.7em}
#btn_add {margin-bottom:10px;text-align:right}
#btn_add a {display:inline-block;padding:0 15px;height:30px;border:0;background:#ff3061;color:#fff;text-decoration:none;line-height:2.5em;vertical-align:middle}
/* 필수입력 */
.required {background:url('../img/wrest.gif') #f7f7f7 top right no-repeat !important}
/* 폼 */
label {vertical-align:middle}
textarea, .frm_input {padding:2px;border:1px solid #ced9de;background:#f6f9fa;vertical-align:middle}
textarea:focus,
.frm_input:focus {border-color:#000;background:#434f54;color:#fff}
.frm_input:focus,
.required:focus {border-color:#000;background:#434f54 !important;color:#fff}
textarea {width:90%}
select {border:1px solid #ced9de}
button {padding:3px;border:1px solid #ced9de;background:#f6f9fa;cursor:pointer}

View File

@ -122,6 +122,9 @@ a:active {color:#000;text-decoration:underline}
.bo_sideview td {padding:6px 4px} /* 사이드뷰 사용하는 테이블 셀 패딩값 */
td.empty_table {padding:85px 0;text-align:center}
/* 필수입력 */
.required {background:url('../img/wrest.gif') #f7f7f7 top right no-repeat !important}
/* 폼 테이블 */
.frm_tbl {margin-bottom:20px;width:100%;border-collapse:collapse;border-spacing:0}
.frm_tbl caption {padding:10px 0;color:#4b8b99;font-weight:bold;text-align:left}
@ -130,7 +133,8 @@ td.empty_table {padding:85px 0;text-align:center}
.frm_tbl textarea,
.frm_input {padding:2px 2px 3px;border:1px solid #b8c9c2;background:#f7f7f7;vertical-align:middle}
.frm_tbl textarea:focus,
.frm_input:focus {padding:3px 3px 4px;border:0;background:#21272e;color:#fff}
.frm_input:focus,
.required:focus {padding:3px 3px 4px;border:0;background:#21272e !important;color:#fff}
.frm_tbl textarea {width:90%;height:150px}
.frm_address {display:block;margin-top:5px}
.frm_file {display:block;margin-bottom:5px}

View File

@ -1,7 +1,5 @@
var wrestMsg = "";
var wrestFld = null;
var wrestFldDefaultColor = "";
var wrestFldBackColor = "#ff3061";
// subject 속성값을 얻어 return, 없으면 tag의 name을 넘김
function wrestItemname(fld)
@ -284,8 +282,6 @@ function wrestSubmit()
var array_css = el.className.split(" "); // class 를 공백으로 나눔
el.style.backgroundColor = wrestFldDefaultColor;
// 배열의 길이만큼 돌려라
for (var k=0; k<array_css.length; k++) {
var css = array_css[k];
@ -323,7 +319,6 @@ function wrestSubmit()
alert(wrestMsg);
if (wrestFld.style.display != "none") {
wrestFld.style.backgroundColor = wrestFldBackColor;
if (typeof(wrestFld.select) != "undefined")
wrestFld.select();
wrestFld.focus();
@ -350,20 +345,6 @@ function wrestInitialized()
document.forms[i].oldsubmit = document.forms[i].onsubmit;
}
document.forms[i].onsubmit = wrestSubmit;
// 이 부분은 CSS 로 대체를 합니다. github issue #282, 지운아빠 작업예정
for (var j = 0; j < document.forms[i].elements.length; j++) {
// 필수 입력일 경우는 * 배경이미지를 준다.
if (document.forms[i].elements[j].getAttribute("required") != null ||
regexp.test(document.forms[i].elements[j].className)) {
//if (regexp.test(document.forms[i].elements[j].className)) {
//document.forms[i].elements[j].style.backgroundColor = wrestFldDefaultColor;
//document.forms[i].elements[j].className = "wrest_required";
document.forms[i].elements[j].style.backgroundImage = "url('"+g4_img_url+"/wrest.gif')";
document.forms[i].elements[j].style.backgroundPosition = "top right";
document.forms[i].elements[j].style.backgroundRepeat = "no-repeat";
}
}
}
}

View File

@ -9,9 +9,9 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<fieldset>
<input type="hidden" name="url" value="<?=$outlogin_url?>">
<label for="ol_id" id="ol_idlabel">회원아이디<strong class="sound_only">필수</strong></label>
<input type="text" id="ol_id" name="mb_id" maxlength="20" required>
<input type="text" id="ol_id" name="mb_id" class="required" maxlength="20" required>
<label for="ol_pw" id="ol_pwlabel">패스워드<strong class="sound_only">필수</strong></label>
<input type="password" id="ol_pw" name="mb_password" maxlength="20" required>
<input type="password" id="ol_pw" name="mb_password" class="required" maxlength="20" required>
<input type="submit" id="ol_submit" value="로그인">
<div id="ol_svc">
<a href="<?=G4_BBS_URL?>/register.php"><b>회원가입</b></a>