index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</head>
<body>
<h2>송부 정보의 입력</h2>
<form id="frm" action="NewFile.jsp">
이 름: <input type="text" name="name" /><br>
<br> 우편번호: <input type="text" name="mail1">-<input type="text" name="mail2"> <button>주소
변환</button>
<br>
<br> 주소 <input type="text" name="address"><br>
<br>전화번호 <input type="text" name="phone1">-<input type="text" name="phone2">-<input type="text" name="phone3"><br>
<br><br>
<select name="select">
<option value="지정하지 않음">지정하지 않음</option>
<option value="10:00 ~12:00">10:00 ~12:00</option>
<option value="12:00 ~13:00">12:00 ~13:00</option>
<option value="15:00 ~17:00">15:00 ~17:00</option>
<option value="17:00 ~20:00">17:00 ~20:00</option>
</select>
<br><br>
<br> 영수증요청: <input type="checkbox" name="bill" value="요청">
<br>
<br> 메일 매거진을 수신 <input type="radio" name="mailReceive" value="신청">신청 <input type="radio" name="mailReceive" value="신청하지 않음">신청하지않음
<br><br>
<button id="submit">확인화면으로진행</button>
</form>
</select>
<script>
$(function() {
$("#submit").on("click", function() {
$("#frm").submit();
})
$("input").focus(
function() {
$(this).css("background-color", "#ffff00");
}
);
$("input").blur(function() {
$(this).css("background-color", "#fff");
});
})
</script>
</body>
</html>
NewFile.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String name = request.getParameter("name");
out.println("name:" + name);
String mail1 = request.getParameter("mail1");
String mail2 = request.getParameter("mail2");
out.println("우편번호: " + mail1 + " - " + mail2);
String phone1 = request.getParameter("phone1");
String phone2 = request.getParameter("phone2");
String phone3 = request.getParameter("phone3");
out.println("우편번호: " + phone1 + " - " + phone2 + " - " + phone3);
String select = request.getParameter("select");
out.println("배달시간: " + select);
String bill = request.getParameter("bill");
out.println("영수증요청: " + bill);
String mailReceive = request.getParameter("mailReceive");
out.println("메일 매거진을 수신");
%>
</body>
</html>
'JavaScript > jQuery' 카테고리의 다른 글
제이쿼리 기초부분 정리 (0) | 2020.01.14 |
---|---|
제이쿼리 기본 태그 조작법 (0) | 2020.01.13 |
제이쿼리 , JSP 간 연동1 (0) | 2020.01.13 |
제이쿼리 filter, blur, hide, show, toggle (0) | 2020.01.13 |
제이쿼리 테이블에 값 넣기 (0) | 2020.01.13 |