From 544e0a621a1466f9e193fdeede7cdd6ec004624d Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 21 Jan 2013 18:56:04 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=84=EB=93=9C=EC=9D=98=20=ED=95=B4?= =?UTF-8?q?=EB=8B=B9=20label=20=EA=B0=92=EC=9D=84=20=EC=9D=BD=EC=96=B4?= =?UTF-8?q?=EC=84=9C=20=EB=B3=B4=EC=97=AC=EC=A3=BC=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/wrest.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/js/wrest.js b/js/wrest.js index 33f7975f5..4a594abaf 100644 --- a/js/wrest.js +++ b/js/wrest.js @@ -6,7 +6,29 @@ var wrestFldBackColor = "#ff3061"; // subject 속성값을 얻어 return, 없으면 tag의 name을 넘김 function wrestItemname(fld) { - return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("alt") ? fld.getAttribute("alt") : fld.name ); + //return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("alt") ? fld.getAttribute("alt") : fld.name ); + var id = fld.getAttribute("id"); + var labels = document.getElementsByTagName("label"); + var el = null; + + for(i=0; i].*[<]\/+.*[>]/gi, ""); + + if(text == '') { + return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("alt") ? fld.getAttribute("alt") : fld.name ); + } else { + return text; + } + } else { + return fld.getAttribute("title") ? fld.getAttribute("title") : ( fld.getAttribute("alt") ? fld.getAttribute("alt") : fld.name ); + } } // 양쪽 공백 없애기 @@ -257,7 +279,7 @@ function wrestSubmit() // 셀렉트 박스일때도 필수 선택 검사합니다. select-one if (el.type=="text" || el.type=="hidden" || el.type=="file" || el.type=="password" || el.type=="select-one" || el.type=="textarea") { if (el.getAttribute("required") != null) { - wrestRequired(el); + wrestRequired(el); } var array_css = el.className.split(" "); // class 를 공백으로 나눔 @@ -331,7 +353,7 @@ function wrestInitialized() for (var j = 0; j < document.forms[i].elements.length; j++) { // 필수 입력일 경우는 * 배경이미지를 준다. - if (document.forms[i].elements[j].getAttribute("required") != null || + 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;