ข้อมูลอ้างอิงHTML

HTML โดยตัวอักษร HTML ตามหมวดหมู่ รองรับ HTML Browser แอตทริบิวต์ HTML HTML Global Attributes เหตุการณ์ HTML HTML สี HTML Canvas HTML เสียง/วิดีโอ ชุดอักขระ HTML HTML Doctypes การเข้ารหัส URL HTML รหัสภาษา HTML รหัสประเทศ HTML ข้อความ HTTP วิธี HTTP ตัวแปลง PX เป็น EM แป้นพิมพ์ลัด


HTML <input> รูปแบบแอตทริบิวต์

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

  • An absolute URL - the full address of a page (like href="http://www.example.com/formresult.asp")
  • A relative URL - points to a file within the current site (like href="formresult.asp")

❮ แท็ก HTML <input>