wrest.js overflow 로 인한 복구
This commit is contained in:
21
js/wrest.js
21
js/wrest.js
@ -1,5 +1,7 @@
|
||||
var wrestMsg = "";
|
||||
var wrestFld = null;
|
||||
var wrestFldDefaultColor = "";
|
||||
var wrestFldBackColor = "#ff3061";
|
||||
|
||||
// subject 속성값을 얻어 return, 없으면 tag의 name을 넘김
|
||||
function wrestItemname(fld)
|
||||
@ -282,6 +284,8 @@ 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];
|
||||
@ -319,6 +323,7 @@ function wrestSubmit()
|
||||
alert(wrestMsg);
|
||||
|
||||
if (wrestFld.style.display != "none") {
|
||||
wrestFld.style.backgroundColor = wrestFldBackColor;
|
||||
if (typeof(wrestFld.select) != "undefined")
|
||||
wrestFld.select();
|
||||
wrestFld.focus();
|
||||
@ -345,6 +350,20 @@ 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_url+"/js/wrest.gif')";
|
||||
document.forms[i].elements[j].style.backgroundPosition = "top right";
|
||||
document.forms[i].elements[j].style.backgroundRepeat = "no-repeat";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,4 +371,4 @@ function wrestInitialized()
|
||||
$(document).ready(function(){
|
||||
// onload
|
||||
wrestInitialized();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user