表單程式碼
你可以在表單頁面找到表單專屬連結。

將程式碼貼到前端頁面表單的<form> action屬性中
<form action="https://formmy.co/f/Your-Code" method="POST">
<input type="text" name="name">
<input type="email" name="email">
<input type="tel" name="tel">
<button type="submit">送出</button>
</form>
1
2
3
4
5
6
2
3
4
5
6
表單送出後將使用者導到感謝頁面。

小提醒
你可以設定轉址位置將轉址到你想要的位置
處理 checkbox
使用 checkbox 時,需要在你的 <form> 表單裡面另外加入一個隱藏的
<input type="hidden" name="subscribe" value="no">,並將 value 設定為 value="no",而原先 checkbox 的 value 則設定為 value="yes"。
範例如下:
<form action="https://formmy.co/f/Your-Code" method="POST">
<input type="hidden" name="subscribe" value="no">
<input type="checkbox" name="subscribe" value="yes" checked>
<input type="text" name="name">
<button type="submit">送出</button>
</form>
1
2
3
4
5
6
2
3
4
5
6
注意
互相對應的 checkbox 欄位 name 必須要相同,不然 Formmy 會收不到資料喔!
多選 checkbox
如果要處理多選的 checkbox 記得要在 name 屬性上加上 [] 另外你也可以在表單上加上隱藏的 <input type="hidden" name="fruit" value="no choice"> 如果使用者沒有填寫選擇任何一個選項,會預設 no choice
範例如下:
<form action="https://formmy.co/f/Your-Code" method="POST">
<input type="hidden" name="fruit" value="no choice">
<input type="checkbox" name="fruit[]" value="banana">香蕉
<input type="checkbox" name="fruit[]" value="watermelon">西瓜
<input type="checkbox" name="fruit[]" value="apple">蘋果
<button type="submit">送出</button>
</form>
1
2
3
4
5
6
7
2
3
4
5
6
7