JSP(Ajax)_04

2024. 12. 31. 14:47·JSP/기초 내용 정리

2024-12-30

 

 

 

<%@ 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>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript">

	$(function() {		// 문서의 body 부분을 읽고 jquery 를 실행하는 코드(무명 콜백함수)
		
		$(".submit").on("click", function() {
			let txt = $("form").serialize();		// 데이터를 쿼리 스트링식으로 순서대로 전달(get 방식)
			
			alert(txt);
		});
	});

</script>
</head>
<body>

	<div align="center">
		<form>
			<table border="1" width="350">
				<tr>
					<td colspan="2" align="center">
						<h3>폼 데이터를 쿼리 스트링으로 전달</h3>
					</td>
				</tr>
				
				<tr>
					<th>아이디</th>
					<td><input name="id"></td>
				</tr>
				
				<tr>
					<th>비밀번호</th>
					<td><input type="password" name="pwd"></td>
				</tr>
				
				<tr>
					<th>나 이</th>
					<td><input name="age"></td>
				</tr>
				
				<tr>
					<th>연락처</th>
					<td><input name="phone"></td>
				</tr>
				
				<tr>
					<td colspan="2" align="center">
						<input type="submit" value="전송" class="submit">
						<input type="reset" value="취소">
					</td>
				</tr>
			</table>
		</form>
	</div>

</body>
</html>

'JSP > 기초 내용 정리' 카테고리의 다른 글

JSP(Ajax)_Customer  (0) 2024.12.31
JSP(Ajax)_Join  (0) 2024.12.31
JSP(Ajax)_03  (0) 2024.12.31
JSP(Ajax)_02  (0) 2024.12.31
JSP(Ajax)_01  (0) 2024.12.31
'JSP/기초 내용 정리' 카테고리의 다른 글
  • JSP(Ajax)_Customer
  • JSP(Ajax)_Join
  • JSP(Ajax)_03
  • JSP(Ajax)_02
mw41817
mw41817
일생의 개발 기록 저장소
  • mw41817
    IT 개발 일지
    mw41817
    • Index (487)
      • HTML (36)
        • 기초 내용 정리 (36)
      • CSS (29)
        • 기초 내용 정리 (29)
      • JavaScript (60)
        • 기초 내용 정리 (60)
      • JQuery (38)
        • 기초 내용 정리 (38)
      • Java (232)
        • 기초 내용 정리 (232)
      • JSP (46)
        • 기초 내용 정리 (46)
      • Spring, Boot (31)
        • 기초 내용 정리 (31)
      • DB (5)
        • Oracle SQL (5)
      • Code WorkBook (6)
        • programmers (6)
        • Baekjoon (0)
      • 기타 (1)
        • 유용한 사이트 (3)
  • 전체
    오늘
    어제
  • 글쓰기 관리
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 카테고리
    • 주인장 GitHub
  • 공지사항

  • 인기 글

  • 태그

    html #코딩 #프로그래밍 #기초
  • 최근 댓글

  • hELLO· Designed By정상우.v4.10.0
mw41817
JSP(Ajax)_04
상단으로

티스토리툴바