IE10 에서 input 태그에 required 문제...

오늘 window7 에서 IE10 설치해서 운영중인 사이트 글쓰기를 하려고 했더니....

모든 입력값이 필수입력하라고 나오더군요... 확인해보니... 아래의 사항이 문제가 있는듯합니다.

wrest.js

// 초기에 onsubmit을 가로채도록 한다.
function wrestInitialized()
{
for (var i = 0; i < document.forms.length; i++)
{
// onsubmit 이벤트가 있다면 저장해 놓는다.
if (document.forms[i].onsubmit) document.forms[i].oldsubmit = document.forms[i].onsubmit;
document.forms[i].onsubmit = wrestSubmit;
for (var j = 0; j < document.forms[i].elements.length; j++)
{
// 필수 입력일 경우는 * 배경이미지를 준다.
요기 -> if (document.forms[i].elements[j].getAttribute("required") != null)
{
document.forms[i].elements[j].style.backgroundImage = "url("+g4_path+"/js/wrest.gif)";
document.forms[i].elements[j].style.backgroundPosition = "top right";
document.forms[i].elements[j].style.backgroundRepeat = "no-repeat";
}
}
}
}


if (document.forms[i].elements[j].getAttribute("required") != null) IE10에서 이 부분이 문제인것 같더군요...

IE10 에서는 input 태그에 required가 설정되지 않은 것도 document.forms[i].elements[j].getAttribute("required") 이 값이 null 이 아니라.. 그냥 공백을 가져오더군요...


우선 임시방편으로
if (document.forms[i].elements[j].getAttribute("required") != null)
{
요기추가 -> if(document.forms[i].elements[j].getAttribute("required") == "required") {

document.forms[i].elements[j].style.backgroundImage = "url("+g4_path+"/js/wrest.gif)";
document.forms[i].elements[j].style.backgroundPosition = "top right";
document.forms[i].elements[j].style.backgroundRepeat = "no-repeat";
}
}

이렇게 변경하고 게시판 글쓰기 input 태그에 required='required' 라고 값을 지정하고 넘어가긴 했는데... 그누보드 소스 이미 많은 부분에서 그냥 required 라고만 쓴 태그들이 많은지라...

이 부분은 좀 더 ... 괜찮은 해결 방안이 없을지요?
|

댓글 2개

이거 진짜 큰문제네요..;;
정말요.. 이거 좀 큰 문제인듯한데.

뚜렷한 해결책 없나요..
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12년 전 조회 1,026
12년 전 조회 714
12년 전 조회 1,240
12년 전 조회 1,538
12년 전 조회 1,571
12년 전 조회 1,604
12년 전 조회 1,466
12년 전 조회 1,696
12년 전 조회 6,424
12년 전 조회 4,601
12년 전 조회 1,000
12년 전 조회 857
12년 전 조회 1,690
12년 전 조회 1,524
12년 전 조회 968
12년 전 조회 985
12년 전 조회 1,502
12년 전 조회 1,518
12년 전 조회 860
12년 전 조회 963
🐛 버그신고