如何在 HTML 中指定在提交表单时将表单数据发送到哪里?
使用 action 属性来添加文件,单击“提交”按钮后要转到该文件所在的位置。你还可以添加电子邮件,将数据发送到该电子邮件 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>
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP