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

王林
王林 转载
2023-09-18 23:01:02 564浏览

如何在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>

以上就是如何在HTML中指定表单提交时要发送表单数据的位置?的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除