<form> Attributes


Posted by mijouhsieh on 2023-04-08

<input> Attributes

<form> Attributes

action

  • URL處理表單提交。
  • action 的值可以被<button><input type="submit"><input type="image">元素上的 form action 屬性覆蓋。

method

提交表單時使用的HTTP方法:
可能的值:
post:
- The POST method
-
form data作為 request body 傳送(send).

get:
- The GET method
-
<form> 沒寫method屬性時,會預設為 method="get" get請求。

  • get請求<input type="submit">送出表單時,會把輸入框的內容帶到網址上。

- form data 附加在 action URL後面,以 ? separator分隔。
-
當表單沒有 side-effects時,使用此方法。
form tag side-effects ChatGTP

dialog:

  • 當表單位於<dialog>中,提交表單時關閉 dialog對話框。
  • dialog值將被 <button><input type="submit"><input type="image">元素上的 form method 屬性覆蓋。

input-name-attribute.png
<form> 沒寫method屬性時,會預設為 method="get" get請求。

  • get請求<button type="submit">送出表單時,會把輸入框的內容帶到網址上。
  • q 是 `

#<form> Attributes #action #method







Related Posts

CS50 Call Stack

CS50 Call Stack

【Day04】Bootstrap介紹 + 套版

【Day04】Bootstrap介紹 + 套版

Conda 常用指令整理

Conda 常用指令整理


Comments