HTML <form> 액션 속성

❮ HTML <form> 태그

예시

제출 시 양식 데이터를 "action_page.php"라는 파일로 보냅니다(입력을 처리하기 위해):

<form action="/action_page.php" method="get">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="submit" value="Submit">
</form>

정의 및 사용

속성 은 action양식이 제출될 때 양식 데이터를 보낼 위치를 지정합니다.


브라우저 지원

Attribute
action Yes Yes Yes Yes Yes

통사론

<form action="URL">

속성 값

Value Description
URL Where to send the form-data when the form is submitted.

Possible values:

  • An absolute URL - points to another web site (like action="http://www.example.com/example.htm")
  • A relative URL - points to a file within a web site (like action="example.htm")

❮ HTML <form> 태그