Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

submit a form in a new tab

People also ask

How do I submit a form to another page?

To link a submit button to another webpage using HTML Form Tags: Using the HTML Form's Action Attribute, we can link the submit button to a separate page in the HTML Form element. Here, declare/write the “Submit button” within HTML Form Tags and give the File Path inside the HTML form's action property.

How do you open a new window on form submit in JavaScript?

open() Features. To submit form to new window, we set the target attrubutes to '_blank'.

Which attribute is used for the submitted form will open in a new tab or same window?

The <form> target Attribute in HTML is used to specify whether the submitted result will open in the current window, a new tab, or on a new frame ie., this attribute specifies a name or a keyword that shows where to display the reply, once the form is submitted.


<form target="_blank" [....]

will submit the form in a new tab... I am not sure if is this what you are looking for, please explain better...


It is also possible to use the new button attribute called formtarget that was introduced with HTML5.

<form>
  <input type="submit" formtarget="_blank"/>
</form>

I have a [submit] and a [preview] button, I want the preview to show the print view of the submitted form data, without persisting it to database. Therefore I want [preview] to open in a new tab, and submit to submit the data in the same window/tab.

<button type="submit" id="liquidacion_save"          name="liquidacion[save]"          onclick="$('form').attr('target', '');"      >Save</button></div>    <div>
<button type="submit" id="liquidacion_Previsualizar" name="liquidacion[Previsualizar]" onclick="$('form').attr('target', '_blank');">Preview</button></div>  

Add target="_blank" to the <form> tag.


Since you've got this tagged jQuery, I'll assume you want something to stick in your success function?

success: function(data){
    window.open('http://www.mysite.com/', '_blank');
}