HTML <input> รูปแบบแอตทริบิวต์
ตัวอย่าง
แบบฟอร์ม HTML ที่มีปุ่มส่งสองปุ่ม โดยมีการดำเนินการต่างกัน:
<form action="/action_page.php">
<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">
<input type="submit" formaction="/action_page2.php"
value="Submit to another page">
</form>
ความหมายและการใช้งาน
แอตทริบิวต์formaction
ระบุ URL ของไฟล์ที่จะประมวลผลการควบคุมการป้อนข้อมูลเมื่อส่งแบบฟอร์ม
แอตทริบิวต์formaction
แทนที่action
แอตทริบิวต์ของ
<form>
องค์ประกอบ
หมายเหตุ:คุณลักษณะformaction
นี้ใช้กับ
type="submit"
และtype="image"
.
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนแอตทริบิวต์อย่างเต็มที่
Attribute | |||||
---|---|---|---|---|---|
formaction | Yes | 10.0 | Yes | 5.1 | 10.6 |
ไวยากรณ์
<input formaction="URL">
ค่าแอตทริบิวต์
Value | Description |
---|---|
URL | Specifies the URL of the file that will process the input control when the form is submitted. Possible values:
|
❮ แท็ก HTML <input>