회원가입하고 전송하면 테이블 출력
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
form{
border : 2px solid blue;
margin : 10px;
padding : 5px;
width : 300px;
height : auto;
}
label{
display : inline-block;
width : 80px;
height : 30px;
}
</style>
<script>
function proc(){
var namevalue = document.ff2.name.value.trim();
if(namevalue.length<1){
alert("이름을 입력해주세요");
return false;
}
var gendervalue = document.ff2.gender.value.trim();
if(gendervalue.length<1){
alert("성별을 선택해주세요");
return false;
}
var addrvalue = document.ff2.add.value.trim();
if(addrvalue.length<1){
alert("주소를 입력해주세요");
return false;
}
var emailvalue = document.ff2.email.value.trim();
if(emailvalue.length<1){
alert("이메일을 입력해주세요");
return false;
}
alert("입력성공")
document.ff2.submit();
}
</script>
</head>
<body>
<h1> 회원가입 화면</h1>
<form name="ff2" action = "집2.jsp" method="post" onsubmit="return false;">
<label>이름</label>
<input type="text" name="name"><br>
<label>주소</label>
<input type="text" name="add"><br>
<label>이메일</label>
<input type="text" name="email"><br>
<input type ="radio" name="gender" value="남자">남자<br>
<input type ="radio" name="gender" value="여자">여자<br>
<input type="submit" value="send" onclick="proc()">
<input type="reset" value="원래대로">
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
td{
width: 100px;
height : 50px;
text-align : center;
}
.title{
background : lightblue;
}
#area{
height : 200px;
}
</style>
</head>
<body>
<%
request.setCharacterEncoding("UTF-8");
String name = request.getParameter("name");
String gender = request.getParameter("gender");
String add = request.getParameter("add");
String email = request.getParameter("email");
%>
<table border = "1">
<tr>
<td class ="title">이름</td>
<td><%=name %></td>
<td class ="title">성별</td>
<td colspan="3"><%=gender %></td>
</tr>
<tr>
<td class ="title">주소</td>
<td colspan="3"><%=add %></td>
</tr>
<tr>
<td class ="title">이메일</td>
<td colspan="3"><%=email %></td>
</tr>
</table>
</body>
</html>
Author And Source
이 문제에 관하여(회원가입하고 전송하면 테이블 출력), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@susan9905/회원가입하고-전송하면-테이블-출력저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)