필드에 추가로 + - 설정 하는 소스 좀 봐주세요 정보
필드에 추가로 + - 설정 하는 소스 좀 봐주세요본문
첨부 파일처럼 필드에 내용필드를 추가할때 하려고 수정했는대..
소스가 이상한건지.. 좀 봐주십시요..
<tr>
<td style='padding-left:20px; height:30px;'>· <font color=#000000><b>S/N 입력 </b>
<span onclick="add_file22();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>+
</span>
<span onclick="del_file22();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>-
</span></b></td>
<td><table id="variableFiles2"></table></td>
<script language="JavaScript">
var flen = 0;
function add_file22(delete_code)
{
var upload_count = <?=(int)$board[bo_upload_count]?>;
if (upload_count && flen >= upload_count)
{
}
var objTbl;
var objRow;
var objCell;
if (document.getElementById)
objTbl = document.getElementById("variableFiles2");
else
objTbl = document.all["variableFiles2"];
objRow = objTbl.insertRow(objTbl.rows.length);
objCell = objRow.insertCell(0);
objCell.innerHTML = "<input class='wr_7' name=wr_7 id='wr_7' itemname='S/N' required>";
if (delete_code)
objCell.innerHTML += delete_code;
else
{
<? if ($is_file_content) { ?>
objCell.innerHTML += "<br><input class='wr_7' name=wr_7 id='wr_7' itemname='S/N' required>";
<? } ?>
;
}
flen++;
}
<?=$file_script; //수정시에 필요한 스크립트?>
function del_file22()
{
// file_length 이하로는 필드가 삭제되지 않아야 합니다.
var file_length = <?=(int)$file_length?>;
var objTbl = document.getElementById("variableFiles2");
if (objTbl.rows.length - 1 > file_length)
{
objTbl.deleteRow(objTbl.rows.length - 1);
flen--;
}
}
</script>
소스가 이상한건지.. 좀 봐주십시요..
<tr>
<td style='padding-left:20px; height:30px;'>· <font color=#000000><b>S/N 입력 </b>
<span onclick="add_file22();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>+
</span>
<span onclick="del_file22();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>-
</span></b></td>
<td><table id="variableFiles2"></table></td>
<script language="JavaScript">
var flen = 0;
function add_file22(delete_code)
{
var upload_count = <?=(int)$board[bo_upload_count]?>;
if (upload_count && flen >= upload_count)
{
}
var objTbl;
var objRow;
var objCell;
if (document.getElementById)
objTbl = document.getElementById("variableFiles2");
else
objTbl = document.all["variableFiles2"];
objRow = objTbl.insertRow(objTbl.rows.length);
objCell = objRow.insertCell(0);
objCell.innerHTML = "<input class='wr_7' name=wr_7 id='wr_7' itemname='S/N' required>";
if (delete_code)
objCell.innerHTML += delete_code;
else
{
<? if ($is_file_content) { ?>
objCell.innerHTML += "<br><input class='wr_7' name=wr_7 id='wr_7' itemname='S/N' required>";
<? } ?>
;
}
flen++;
}
<?=$file_script; //수정시에 필요한 스크립트?>
function del_file22()
{
// file_length 이하로는 필드가 삭제되지 않아야 합니다.
var file_length = <?=(int)$file_length?>;
var objTbl = document.getElementById("variableFiles2");
if (objTbl.rows.length - 1 > file_length)
{
objTbl.deleteRow(objTbl.rows.length - 1);
flen--;
}
}
</script>
댓글 전체
안된다는건가요? 테스트 해보니 잘되는데용