首页 > 文章列表 > 如何在HTML中指定表单提交时要发送表单数据的位置?

如何在HTML中指定表单提交时要发送表单数据的位置?

HTML 表单 提交位置
353 2023-09-15

使用操作属性添加文件,点击提交按钮后您想要到达的位置。您还可以添加电子邮件以将数据发送到该电子邮件 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>