Use of the target attribute provides an unambiguously machine-readable indication that a new window will open. User agents can inform the user, and can also be configured not to open the new window.
HTML <form> target Attribute_blank: It opens the link in a new window. _self: It opens the linked document in the same frame & this is the default value. _parent: It opens the linked document in the parent frameset. _top: It opens the linked document in the full body of the window.
target="_blank" is a special keyword that will open links in a new tab every time. target="blank" will open the first-clicked link in a new tab, but any future links that share target="blank" will open in that same newly-opened tab.
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 :
<form action="demo_form.asp" method="get" target="_blank">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form.
The target attribute defines a name of, or keyword for, a browsing context (e.g. tab, window, or inline frame).
Target Attribute Values:
_blank : The response is displayed in a new window or tab
_self : The response is displayed in the same frame (this is default)
_parent : The response is displayed in the parent frame
_top : The response is displayed in the full body of the window
framename : The response is displayed in a named iframe
Now come to your code.
method="POST" id="myForm" enctype="multipart/form-data" target="hidden_iframe"
indicates after posting the myForm the response (resultant page) will be occupied by 'hidden_iframe'.
Works exactly the same way as anchor target. In your case, it looks like there is an iframe somewhere with name="hidden_iframe"
- that's where the response from the form will be displayed.
Here is the description of form targets
A name or keyword indicating where to display the response that is received after submitting the form. In HTML 4, this is the name of, or a keyword for, a frame. In HTML5, it is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame).
Source: <form> - HTML | MDN #target
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With