Thuộc tính hành động <form> HTML
Thí dụ
Khi gửi, hãy gửi dữ liệu biểu mẫu đến một tệp có tên "action_page.php" (để xử lý đầu vào):
<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>
Định nghĩa và Cách sử dụng
Thuộc action
tính chỉ định nơi gửi dữ liệu biểu mẫu khi biểu mẫu được gửi.
Hỗ trợ trình duyệt
Attribute | |||||
---|---|---|---|---|---|
action | Yes | Yes | Yes | Yes | Yes |
Cú pháp
<form action="URL">
Giá trị thuộc tính
Value | Description |
---|---|
URL | Where to send the form-data when the form is submitted. Possible values:
|
❮ Thẻ <form> HTML