html表单提交后跳转页面
时间: 2023-08-16 20:05:21 浏览: 225
当HTML表单提交后,可以通过设置表单的 "action" 属性,来指定表单提交的URL地址。例如:
```
<form action="http://example.com/submit" method="post">
...
</form>
```
上面的代码表示,当表单提交时,会将表单数据POST到 "http://example.com/submit" 这个URL地址。
当表单提交后,浏览器会自动跳转到指定的URL地址,如果需要在提交后停留在当前页面,可以在表单中添加 "target" 属性,例如:
```
<form action="http://example.com/submit" method="post" target="_self">
...
</form>
```
上面的代码表示,当表单提交时,会将表单数据POST到 "http://example.com/submit" 这个URL地址,但是在提交后会停留在当前页面。
阅读全文
相关推荐
















