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:
|
❮ แท็ก HTML <form>