在 HTML 中提交表單時,如何指定將表單資料傳送到何處?
使用操作屬性來新增檔案,在單擊“提交”按鈕後,這是你需要傳送到的位置。您還可以新增電子郵件,將資料傳送到該電子郵件 ID。
示例
您可以嘗試執行以下程式碼,以在 HTML 中提交表單時設定向何處傳送表單資料 -
<!DOCTYPE html> <html> <body> <h2>Student Contact Form</h2> <form action = "mailto:emailid@example.com" method = "post" enctype = "text/plain"> Student Name:<br><input type = "text" name = "sname"> <br> Student Subject:<br><input type = "text" name = "ssubject"><br> <input type = "submit" value = "Send"> </form> </body> </html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP