HTML表单标签中的target属性有什么用处? [英] What is the use of target attribute in HTML form tag?
问题描述
当我在PHP中实现文件上传进度条时,我在 form
标签中看到了这个目标属性。代码如下所示:
< form action =<?php echo $ _SERVER [PHP_SELF];? >中
method =POSTid =myForm
enctype =multipart / form-data
target =hidden_iframe>
这个目标属性的用途
实际上,在提交此表单数据(文件)后,我们会跟踪另一个页面上传进度,例如 upload.php
。我们可以在没有target属性的情况下实现这个吗?
用于指定在哪个窗口中显示响应远程服务器提交您的表单。
可能的值包括:
While I was implementing a file upload progress bar in PHP, I saw this target attribute in form
tag. The code was like this:
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>"
method="POST" id="myForm"
enctype="multipart/form-data"
target="hidden_iframe">
What is the use of this target attribute
here?
Actually, after submitting this form data (file) we track the upload progress from another page say upload.php
. Could we implement this without the target attribute?
That is used to specify in which window you would like to show the response from the remote server upon submitting your form.
Possible values are :
- _blank - new page
- frame - show in the iframe with the given name
- _self - show in the same iframe where the form locates
- _parent - show in the parent page/iframe of the form's iframe
- _top - the top most window
这篇关于HTML表单标签中的target属性有什么用处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!