여분필드 능동배치 - 예제 22개 > 팁

본문 바로가기
사이트 내 전체검색

여분필드 능동배치 - 예제 22개

페이지 정보

profile_image
작성자 비타주리
댓글 0건 조회 2,606회 작성일 22-01-18 20:10

본문

<style>.iptStyle { width:100%; height:40px; padding:5px; border:1px solid #cccccc; background-color:#ffffff; border-radius:3px; box-sizing:border-box; }</style>
<script>
inputTotal = 22;
widthTotal = 4;
inputGap = 3;
topString = "my_";
inputRequired = [3,7,9,16,17,22];
inputIdName = "<input type=text class=iptStyle>";
document.write("<table id=inputTable style=width:100%;table-layout:fixed cellpadding=0 cellspacing=0></tr>");
for (n = 1; n <= inputTotal; n++) {
if (n % widthTotal == 0) {
if (inputTotal <= widthTotal || n == inputTotal) document.write("<td>" + inputIdName + "</td>");
else document.write("<td>" + inputIdName + "</td></tr><tr><td style=height:" + inputGap + "px></td></tr><tr>");
}
else document.write("<td>" + inputIdName + "</td><td style=width:" + inputGap + "px></td>");
}
document.write("</tr></table>");
ipt = inputTable.getElementsByTagName("input");
for (n = 1; n <= ipt.length; n++) {
ipt[n - 1].id = ipt[n - 1].name = topString + n;
for (iptr in inputRequired) {
if (inputRequired[iptr] == n) {
ipt[n - 1].required = true;
ipt[n - 1].style.backgroundColor = "#eeeeee";
}
}
ipt[n - 1].placeholder = "여분필드_" + n;
}
</script>

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

사이트 정보

회사명 : 회사명 / 대표 : 대표자명
주소 : OO도 OO시 OO구 OO동 123-45
사업자 등록번호 : 123-45-67890
전화 : 02-123-4567 팩스 : 02-123-4568
통신판매업신고번호 : 제 OO구 - 123호
개인정보관리책임자 : 정보책임자명

공지사항

  • 게시물이 없습니다.

접속자집계

오늘
131
어제
144
최대
526
전체
107,929
Copyright © 소유하신 도메인. All rights reserved.