[HTML 예제] 폼태그 (form tag) :: 소림사의 홍반장!

[HTML 예제] 폼태그 (form tag)

2012. 9. 12. 19:01 - 삘쏘굿

폼태그

 

실행 소스

<?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 action="" method="post">

               <label for="userid">유저아이디</label>

               <input type="text" name="userid" id="userid" /><br />

               <label for="pass">비밀번호</label>

               <input type="password" name="pass" id="pass" /><br />

               <label for="job">직업</label>

               <select name="job" id="job">

                       <option>개발자</option>

                       <option>프로그래머</option>

                       <option>자영업자</option>

               </select><br />

               <label for="gender">성별</label>

               <input type="radio" name="gender" value="m" />

               <input type="radio" name="gender" value="f" /> <br />

               <label for="hobby">취미</label>

               <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>



실행 결과





독서 드라마보기 축구
영화보기 드라마보기 게임

 

 

 

 

get 방식으로 실행했을때

 

post 방식으로 실행했을때 

 




다른 카테고리의 글 목록

Dev. 웹/HTML.JSP 카테고리의 포스트를 톺아봅니다