<?xml version="1.0" encoding="EUC-KR" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR" />
<title>폼태그</title>
</head>
<body>
<!-- form의 action : submit시 가게될 주소 -->
<!--
form의 방식
get방식은 주소창에 입력한 값이 보여지지만
post방식은 주소창에 값이 보이지않지만 입력을 확인하는 텍스트 박스가 나온다.
-->
<form action="http://@localhost:port/hp" method="post">
<!-- input타입이 텍스트인경우 일반 텍스트로 입력받는다. -->
<label for="userid">유저아이디</label>
<input type="text" name="userid" id="userid" /> <br/>
<!-- password인 경우 입력한 값이 보이지 않는다. -->
<label for="pass">비밀번호</label>
<input type="password" name="pass" id="pass" /> <br/>
<!-- select는 option중 한가지를 선택하도록 한다. -->
<label for="job">직업</label>
<select name="job" id="job">
<option>개발자</option>
<option>프로그래머</option>
<option>자영업자</option>
</select> <br />
<!-- radio는 여러개 선택이 불가능하다. -->
<label for="gender">성별</label>
<input type="radio" name="gender" value ="m" /> 남
<input type="radio" name="gender" value ="f" /> 여 <br />
<label for="hobby">취미</label>
<!-- checkbox는 여러개 선택이 가능하다. -->
<input type ="checkbox" name="hobby" value="reading" /> 독서
<input type ="checkbox" name="hobby" value="drama" /> 드라마보기
<input type ="checkbox" name="hobby" value="soccer" /> 축구 <br />
<input type ="checkbox" name="hobby" value="movie" /> 영화보기
<input type ="checkbox" name="hobby" value="basket" /> 농구
<input type ="checkbox" name="hobby" value="game" /> 게임 <br />
<!-- 입력한 값을 리셋한다. -->
<input type="reset" value="리셋" />
<!-- 입력한 값을 제출한다. -->
<input type="submit" value="완료" />
</form>
</body>
</html>
② 실행화면
'WEB > HTML' 카테고리의 다른 글
WEB 2일차 두번째) a태그 (0) | 2012.09.13 |
---|---|
WEB 1일차 세번째) Table태그 (0) | 2012.09.13 |
WEB 1일차 두번째) H태그(헤더태그)와 P태그(문단태그) (0) | 2012.09.13 |