survey/sInput
sInput.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>suInputItem.jsp</title>
<script>
function addItem() {
var sItem=myform.part.value;
location.href='${contextPath}/survey/sInputItem?sItem='+sItem;
}
</script>
<style>
body {
width : 600px;
margin : 0px auto;
}
table, h2 {
width : 100%;
border-collapse : collapse;
text-align: center;
}
th, td {
border : 1px solid #ccc;
padding: 15px;
text-align:left;
}
th {
width : 20%;
background-color: orange;
}
td {
width : 80%;
}
</style>
<body>
<jsp:include page="/WEB-INF/views/include/bs.jsp"></jsp:include>
<div style="text-align:center">
<p><br/></p><p><br/></p>
<form name="myform" method="post">
<h2>설문지 항목 등록 하기</h2>
<table>
<tr>
<th>설문지 주제명</th>
<td>${vo.subject}</td>
</tr>
<tr>
<th>설문 기간</th>
<td>${fn:substring(vo.sdate,0,10)} ~ ${fn:substring(vo.edate,0,10)}</td>
</tr>
<tr>
<th>설문개수</th>
<td>
<select name="part" onchange="addItem()">
<c:forEach var="i" begin="1" end="8" step="1">
<option value="${i}" <c:if test='${i eq sItem}'>selected</c:if>>${i}</option>
</c:forEach>
</select>
</td>
</tr>
<c:forEach var="cnt" begin="1" end="${sItem}" step="1">
<tr>
<th>설문지 항목 ${cnt}</th>
<td><input type="text" name="questionArr"/></td>
</tr>
</c:forEach>
</table>
<br/>
<table>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="등록" />
<input type="reset" value="다시입력" />
<input type="button" value="메뉴로 이동" onclick="location.href='${contextPath}/survey/sList'"/>
</td>
</tr>
</table>
<input type="hidden" name="survey_idx" value="${vo.idx}"/>
</form>
</div>
</body>
</html>


'Programing' 카테고리의 다른 글
| [git] 원격 저장소 (repository) push (0) | 2023.04.12 |
|---|---|
| survey/sJoin (0) | 2020.07.10 |
| survey/sList (0) | 2020.07.10 |
| 인터셉터 사용법 (0) | 2020.07.07 |
| 게시판 작업 (0) | 2020.06.29 |