<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
	<title>회원가입 화면</title>
	
	<link href='../../css/join_style.css.css' rel='stylesheet' style='text/css'/>

	<script type="text/javascript">
	
		//필수 입력정보인 아이디, 비밀번호가 입력되었는지 확인하는 함수
		function checkValue()
		{
			if(!document.userInfo.id.value){
				alert("아이디를 입력하세요.");
				return false;
				
			} else if(!document.userInfo.password.value){
				alert("비밀번호를 입력하세요.");
				return false;
				
			} else if(document.userInfo.password.value != document.userInfo.passwordcheck.value){
				alert("비밀번호를 동일하게 입력하세요.");
				return false;
				
			//} else if(document.userInfo.password.value = document.userInfo.passwordcheck.value){
				//alert("사용하실 수 있는 비밀번호입니다.");
				//return false;
				
			} else if(!document.userInfo.address.value){
				alert("회원정보를 입력하세요.");
				return false; //텍스트의 마지막창인 address 주소를 입력하지 않으면 화면이 넘어가지 않는 것을 표현
			 }
			}
		
		
		
		function goLoginForm() {
			location.href="LoginForm.jsp";
		}
		// 취소 버튼 누를 시 로그인 폼 버튼으로 이동
	</script>
	
</head>
<body>
	<!-- div 왼쪽, 오른쪽 바깥여백을 auto로 주면 중앙정렬된다.  -->
	<div id="wrap">
		<br><br>
		<b><font size="6" color="gray">회원가입</font></b>
		<br><br><br>
		
		<form method="post" action="../pro/MemberPro.jsp" name="userInfo" onsubmit="return checkValue()">
			<table>
				<tr>
					<td id="title">아이디</td>
					<td>
						<input type="text" name="id" maxlength="50">
					</td>
				</tr>
						
				<tr>
					<td id="title">비밀번호</td>
					<td>
						<input type="password" name="password" maxlength="50">
					</td>
				</tr>
				
				<tr>
					<td id="title">비밀번호 확인</td>
					<td>
						<input type="password" name="passwordcheck" maxlength="50">
						<input type="submit" value="비밀번호확인" class= "btn">
					</td>
				</tr>
					
				<tr>
					<td id="title">이름</td>
					<td>
						<input type="text" name="name" maxlength="50">
					</td>
				</tr>
					
				<tr>
					<td id="title">성별</td>
					<td>
						<input type="radio" name="gender" value="남" checked>남
						<input type="radio" name="gender" value="여" checked>여
					</td>
				</tr>
					
				<tr>
					<td id="title">생년월일</td>
					<td>
						<input type="text" name="birthyy" maxlength="4" placeholder="년(4자)" size="6">
						<select name="birthmm">
							<option value="">월</option>
							<option value="01" >01</option>
							<option value="02" >02</option>
							<option value="03" >03</option>
							<option value="04" >04</option>
							<option value="05" >05</option>
							<option value="06" >06</option>
							<option value="07" >07</option>
							<option value="08" >08</option>
							<option value="09" >09</option>
							<option value="10" >10</option>
							<option value="11" >11</option>
							<option value="12" >12</option>
						</select>
						<input type="text" name="birthdd" maxlength="2" placeholder="일" size="4">
					</td>
				</tr>
					
				<tr>
					<td id="title">이메일</td>
					<td>
						<input type="text" name="email1" maxlength="50">@
						<select name="email2">
							<option>naver.com</option>
							<option>daum.net</option>
							<option>gmail.com</option>
							<option>nate.com</option>						
						</select>
					</td>
				</tr>
					
				<tr>
					<td id="title">휴대전화</td>
					<td>
						<input type="text" name="phone" />
					</td>
				</tr>
				<tr>
					<td id="title">주소</td>
					<td>
						<input type="text" size="50" name="address"/>
					</td>
				</tr>
			</table>
			<br>
			
			<input type="submit" value="회원가입" class= "btn"/> <input type="button" value="취소" onclick = "goLoginForm()" class= "btn">
		</form>
	</div>
 </body>
</html>