💻
Albert's Til
GitHub
  • 매일매일 조금씩 성장하기
    • README
    • CS
      • Network
      • HTTP
        • NO-CACHE
      • 오류 코드
      • ORM 도구
      • Design Pattern
        • CQRS Pattern
          • Event Sourcing and CQRS pattern
        • Builder Pattern
    • DB
      • MySQL
        • Timeline
        • Pagination
        • Index
        • Database Performance Optimization Strategies
        • B+ tree
        • MySQL Connectors VS MySQL Shell(Scripting) VS MySQL Workbench
        • MySQL Storage Engine Architecture
      • Normalization & Denormalization
      • JPA
        • @Transactional
        • Why JPA?
        • About JPA
        • N+1 Issue
        • Index
        • ElementCollection&CollectionTable
        • orphanRemoval
        • CascadeType
        • Use Subselect
        • Dynamic Instance Creation
        • Paging
        • Order
        • Spefication
        • mappedBy
      • MongoDB
        • ObjectId
      • Why MySQL?
      • ACID properties of transactions
      • Between JPA and JDBC
      • Identifiers in Hibernate/JPA
    • Java
      • Jackson de/serialize
      • Collections.singletonList() vs List.of()
      • Manage dependencies in Gradle
      • Logging Level
      • Bean Validation
      • JVM Internals
        • Threads
          • Frame
        • Shared Between Threads
          • Classloader
            • Class Loader Hierarchy
            • Loading Linking Initialization
      • Java Collection Framework
      • Annotation
      • Generic
      • 디미터 법칙
    • Spring
      • Caching
      • Spring Integration Overview
        • ThreadPollTaskExecutor
        • Messaging Bridge
        • Channel Adapter
        • Poller
        • Configuration and @EnableIntegration
        • Message Endpoints
        • Message Channels
      • HATEOAS
      • @Autowired vs Constructor Dependency Injection
      • Spring Security
        • JWT 토큰 사용한 인가
        • OAuth 2 Login
        • OAuth 2 인증
        • 인가
        • 인증
        • PasswordEncoder
      • IoC Container
      • Filter,Interceptor,AOP,Argument Resolver
      • Spring Annotation
      • About Spring
    • Kafka
      • Error Channel
    • Infra
      • Scale Up || Scale Out
      • Docker
        • Dockerfile
        • Docker Hub Deploy
        • Command
      • Cloud 유형
        • Infrastructure as a Service
        • Platform as a Service
        • Software as a Service
      • 무중단 배포
        • 엔진엑스(Nginx)
      • 코드 자동 배포
        • Technical
      • AWS EC2
        • PEM(Privacy Enhanced Mail) 키
      • AWS RDS
      • AWS S3
    • CodeSquad
      • Spring Boot Project 1주차 회고
      • Spring Boot Project 2주차 회고
      • Spirng Boot Project 3주차 회고
      • Spring Boot Project 4주차 회고
    • Foody Moody 프로젝트
      • Query Performance Comparison
      • HeartCount Asynchronous Issue
      • DeferredResult
      • ResponseBodyEmitter
      • SseEmitter (Spring)
      • Server-Sent Events (SSE)
      • 기술 스택 적용 이유
      • NO-CACHE(HTTP)
      • Transactional
    • DDD
      • AggregateId
    • Test
      • RestAssured
    • Coding and Algorithmic Problems
      • 819. Most Common Word
      • 344. Reverse String
      • 125. Valid Palindrome
      • 937. Reorder Data in Log Files
    • Node
      • Async... Await...
      • Custom Transactional Decorator Challenger
    • Python
      • Python Basic Grammar
        • Comments and Input/Output
        • Variable
        • Data type
        • Operations and syntax
        • List,Tuple,Dictionary,Set
        • Function
        • Conditional statement
        • Loop
    • HTML
      • HTML Basic
      • HTML Basic Tags
      • HTML Form Tags
      • HTML Table Tags
    • CSS
      • CSS Basic
      • CSS Practice
Powered by GitBook
On this page
  • <form>: The Form element
  • form 제출 속성
  • <button>: The Button element
  • <input>: The Input (Form Input) element
  • <label>: The Label element
  • <select>: The HTML Select element
  • <fieldset>: The Field Set element
  • <textarea>: The Textarea element
  • 마무리
  • 참조

Was this helpful?

  1. 매일매일 조금씩 성장하기
  2. HTML

HTML Form Tags

양식

<form>: The Form element

  • 데이터 제출을 위한 대화형 컨트롤이 포함된 문서 섹션이다.

form 제출 속성

  • action: 데이터 제출을 처리하는 URL

  • enctype: 데이터 제출의 MIME 유형(method: post)

    • application/x-www-form-urlencoed: 기본 값

    • multipart/form-data: 파일(if type=file)

    • text/plain: 디버겅 목적으로 유용하다

  • method: HTTP 메서드

  • novalidate: 양식의 유효성 검증을 건너뜀

  • target: 양식 제출의 결과를 표시할 위치

<form action="제출_URL" method="post" enctype="application/x-www-form-urlencoded">
    <label for="name">이름:</label>
    <input type="text" id="name" name="name">
    <label for="email">이메일:</label>
    <input type="email" id="email" name="email">
    <button type="submit" value="제출">
</form>

<button>: The Button element

  • 활성화하는 대화형 요소다 활성화되면 데이터 제출, 대화 상장 열기 등의 작업을 수행할 수 있다.

  • type:

    • submit: 데이터를 서버에 제출한다.(in <form>)

    • reset: 모든 컨트롤을 초기값으로 재설정

    • button: 기본 동작이 없다. 스크립트로 이벤트를 수집할 수 있다.

      • 데이터를 제출용이 아니라면 타입을 button으로 지정해야 합니다.

<button type="submit" value="제출">

<input>: The Input (Form Input) element

  • 사용자로부터 데이터를 받기위한 대화형 컨트롤

<input id="user-name" name="user-name" type="text">
<input id="password" name="password" type="password">

<label>: The Label element

  • 사용자 사용하는 항목에 대한 label이다.

  • <input>또는 <textarea> 와 같은 form 컨트롤과 연결하여 사용한다.

  • 연결 방식

    • for(in <label>)-id(in <input> 등) 방식

    • <label> 안으로 (<!input>)중첩

<label for="user-name">유저 이름</label>
<input id="user-name" name="user-name" type="text">

<select>: The HTML Select element

  • 옵션 메뉴를 제공하는 컨트롤

<select name="dinner" id="dinner">
    <option value="none">메뉴를 선택해주세요</option>
    <optgroup label="중국집 메뉴">
        <option value="짜장면">짜장면</option>
        <option value="짬뽕">짬뽕</option>
        <option value="탕수육">탕수육</option>
    </optgroup>
    <optgroup label="한식집 메뉴">
        <option value="비빔밥">비빔밥</option>
        <option value="불고기">불고기</option>
        <option value="김치찌개">김치찌개</option>
    </optgroup>
</select>

<fieldset>: The Field Set element

  • 웹 form 내에서 여러 컨트롤과 레이블(<label>)을 그룹화한다.

<form action="#">
    <fieldset>
        <legend>성별</legend>
        <label for="male">남</label>
        <input type="radio" name="gender" id="male">
        <label for="female">녀</label>
        <input type="radio" name="gender" id="female">
    </fieldset>
    <button type="submit">제출</button>
</form>

<textarea>: The Textarea element

  • 여러줄의 text를 입력받을 수 있다.

  • 속성

    • cols: 너비

    • rows: 보여주는 입력 줄

    • maxlength: 최대 길이

    • minlength: 최소 길이

    • placeholder: 힌트

<form action="#">
    <label for="comments">의견:</label><br>
    <textarea id="comments" name="comments" cols="50" rows="10" maxlength="500" 
        minlength="10" placeholder="여기에 의견을 입력하세요..."></textarea>
    <button type="submit">제출</button>
</form>

마무리

form은 요즘 많이 사용하지 않다고 하지만 아직까지 실제로 여전히 널리 사용되며 데이터를 전송하는 기본 방법 중 하나로서 그것을 알고 넘어간다고 생각해요.

참조

ChatGPT

Last updated 11 months ago

Was this helpful?

는 많지만 간단하다. 필요할 때 확인

Attributes
https://en.wikipedia.org/wiki/HTML5
오름캠프 백엔드
https://developer.mozilla.org/