admin/item/write.jsp ( category - .ajax() 처리 )
페이지 정보
작성자 관리자 작성일 23-03-19 14:48 조회 903 댓글 0본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/admin/include/header.jsp" %>
<script>
function cate_2(cate){
$.ajax({
url: "category_ok", //전송받을 페이지 경로
type: "post", //데이터 전송 방식
dataType: "text",
data: "ca_id="+cate,
error:function(){ //실패일 경우
alert("실패");
},
success:function(text){ //성공일 경우
$("#category2_result").html(text);
}
});
}
function item_ok(){
document.submit();
}
</script>
<table width=100% height=50 border=0>
<tr>
<td align=center style="color:#777;font-size:14px;font-weight:bold;">[상품관리]</td>
</tr>
</table>
<center>
<form action="write" method="post" enctype="multipart/form-data" onsubmit="return item_ok()">
<table width=480 border=0>
<tr>
<td width=160>상품코드</td>
<td height=24><font color=red>자동으로 처리됨</font></td>
</tr>
<tr>
<td>카테고리</td>
<td>
<select id="category1" name="category1" onchange="cate_2(this.value)">
<option value="">=대분류 선택=</option>
<c:forEach var="c" items="${v }">
<option value="${c.ca_id }">${c.ca_name }</option>
</c:forEach>
</select>
<span id="category2_result">
<select id="category2" name="category2">
<option value="">=대분류를 먼저 선택하세요=</option>
</select>
</span>
</td>
</tr>
<tr>
<td>상품명</td>
<td><input name="it_name"></td>
</tr>
<tr>
<td>업체 아이디</td>
<td><input name="mb_id" value="${sessionScope.id }" readonly></td>
</tr>
<tr>
<td>세일가격</td>
<td><input name="it_sale"></td>
</tr>
<tr>
<td>판매가격</td>
<td><input name="it_price"></td>
</tr>
<tr>
<td>상품 포인트</td>
<td><input name="it_point"></td>
</tr>
<tr>
<td>상품 수량</td>
<td><input type="number" name="it_qty"></td>
</tr>
<tr>
<td>상품 옵션</td>
<td><input name="it_option"></td>
</tr>
<tr>
<td>판매가능</td>
<td>
<input type="radio" name="it_use" value="Y" checked>Y
<input type="radio" name="it_use" value="N">N
</td>
</tr>
<tr>
<td>상품 유형</td>
<td>
<input type="checkbox" name="it_type1" value="Y">히트
<input type="checkbox" name="it_type2" value="Y">추천
<input type="checkbox" name="it_type3" value="Y">신상
<input type="checkbox" name="it_type4" value="Y">인기
<input type="checkbox" name="it_type5" value="Y">할인
</td>
</tr>
<tr>
<td>상품 이미지 1</td>
<td><input type="file" name="file1"></td>
</tr>
<tr>
<td>상품 이미지 2</td>
<td><input type="file" name="file2"></td>
</tr>
<tr>
<td>상품 이미지 3</td>
<td><input type="file" name="file3"></td>
</tr>
<tr>
<td>상품 이미지 4</td>
<td><input type="file" name="file4"></td>
</tr>
<tr>
<td>상품 이미지 5</td>
<td><input type="file" name="file5"></td>
</tr>
<tr>
<td></td>
<td><button>상품추가</button></td>
</tr>
</table>
</form>
</center>
<%@ include file="/admin/include/footer.jsp" %>
댓글목록 0
등록된 댓글이 없습니다.