<script type="text/javascript">
$(document).ready(function() {
//add more file components if Add is clicked
$('#addFile').click(function() {
var fileIndex = $('#tbodyContents tr td').children().length - 5;
$('#tbodyContents').append(
'<tr><th>file'+ fileIndex + '</th>' +
'<td class=\"td_left\"><input type=\"file\" name=\"files['+ (fileIndex -1) +']\" style=\"width:500px; height:16px; padding:2px 0 2px 2px;\" /></td>'+
'</tr>');
});
});
</script>
<table width="100%" border="0" cellspacing="0" summary="">
<caption></caption>
<colgroup>
<col width="20%" />
<col width="*" />
</colgroup>
<tbody id="tbodyContents">
<tr>
<th>제목</th>
<td class="td_left"><input id="subject" name="subject" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>
</tr>
<tr>
<th>이미지 카테고리</th>
<td class="td_left"><input id="imgCategory" name="imgCategory" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>
</tr>
<tr>
<th>키비쥬얼 순서</th>
<td class="td_left"><input id="keyVisual" name="keyVisual" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>
</tr>
<tr>
<th>text1</th>
<td class="td_left"><input id="text1" name="text1" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>
</tr>
<tr>
<th>text2</th>
<td class="td_left"><input id="text2" name="text2" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>
</tr>
<tr>
<th>text3</th>
<td class="td_left"><input id="text3" name="text3" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>
</tr>
<tr>
<th>file1</th>
<td class="td_left"><input name="files[0]" type="file" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>
</tr>
</tbody>
</table>
'Client Standard > JavaScript & jQuery' 카테고리의 다른 글
[jQuery] 이메일 창 활성화 / 비활성화 (0) | 2014.05.30 |
---|---|
[Mobile] 체크하기 (0) | 2014.03.07 |
[jQuery] Input[type=text] Enter 키 누르면 함수호출 (0) | 2014.01.03 |
[Search] 검색 onkeypress 속성 (0) | 2013.12.10 |
[JQuery] opener로 부모창의 document 객체 긁어오기 (프린트) (0) | 2013.12.06 |