Jsp - input ,type

2020. 6. 16. 11:07Jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
//window(창) - location(주소줄)
//- history(방문기록)
//- document(html문서) ->image,link,layer...
//                                            - form(로그인창)->text,password,textarea
//                                            -checkbox, radio
//                                            -select - option
 
//그냥 a.jsp로 이동 <a></a>
//submit은 입력한 텍스트를 가지고 a.jsp로 이동
//method="post" 방식을 하면 주소록에 보이지 않게 텍스트를 가지고 이동 ,주로 로그인화면에서만 사용
//method="get" 방식을 하면 주소록에 보여지게 텍스트를 가지고 이동, 대부분의 모든 화면에서 사용
//라디오는 네임을 같게 하면 여러개중 하나만 체크 가능
//체크박스는 네임을 같게 하면 여러개 중복체크 가능
//목록상자는 여러개를 한번에 보고싶다면 multiple을 사용하고 목록의 갯수만큼 size 선언
</script>
</head>
<body>
<h1>js3/tetst1.html</h1>
<a href="a.jsp">a.jsp이동</a> 
<form action="a.jsp" method="post"> 
텍스트 : <input type="text" name="text"><br>
비밀번호 : <input type="password" name="pass"><br>
긴텍스트 : <textarea name="tx" rows="10" cols="20"></textarea><br>
라디오 : <input type="radio" name="ra" value="ra1">라디오1
             <input type="radio" name="ra" value="ra2">라디오2<br>
체크박스 : <input type="checkbox" name="ch" value="ch1">체크1
                 <input type="checkbox" name="ch" value="ch2">체크2
                 <input type="checkbox" name="ch" value="ch3">체크3<br>
<!--                 <select name="sel" multiple="multiple" size="3"></select> -->
목록상자 :<select name="sel">
<option value="sel1">선택1</option>
<option value="sel2">선택2</option>
<option value="sel3">선택3</option>
</select><br>
숨김텍스트 : <input type="hidden" name="hi" value="hidds"><br>
첨부파일 : <input type="file" name="file" ><br>
<input type="button" value="버튼">
<input type="submit" value="전송버튼">
<input type="reset" value="초기화">
 
 
 
</form>
</body>
</html>
cs

 

 

여러 타입에 대해서 배웠고 이제야 본격적으로 배우고 있다고 생각이 들었다.

전송 버튼을 눌렀을 때 다른 화면으로 넘어간다 거나 초기화 버튼을 눌렀을 경우 내가 체크해 놓았던 것들이 초기화되는 점들이 신기했고 잊어먹지 않게 잘 기억해 놓아야겠다.

'Jsp' 카테고리의 다른 글

Jsp - 버튼제어2  (0) 2020.06.16
Jsp - 버튼제어  (0) 2020.06.16
Jsp - 이미지 제어  (0) 2020.06.16
Jsp - 화면 색 변경  (0) 2020.06.16
Jsp - 페이지 이동  (0) 2020.06.16