submit a form in a new tab
<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...
New tab open always even normal form form submit
you can check button values, and then submit form with you conditions,
<form method="post" name="form">
Name : <br> <input type="text" name="name"/><br />
Address : <br> <input type="text" name="address"/><br />
<input name="submit" type="submit" value="Submit" onclick="formpreview(this.form,this)">
<input type="submit" value="preview" onclick='formpreview(this.form,this)'/>
</form>
<script>
function formpreview(form,btn) {
alert(btn.value);
/*form.target='_blank';
form.action='preview.php';
form.submit();*/
if(btn.value=="preview"){
alert(btn.value);
form.target='_blank';
form.action='preview.php';
form.submit();
}
if(btn.value=="Submit"){
alert(btn.value);
form.target='_self';
form.action='proccess.php?action=submit';
form.submit();
}
}
</script>
Submit form as POST request and open new tab/window in Angular
Import the ReactiveFormsModule in your App.module.ts file
Update:
try it this way:
<form #form method="post" target="_blank" action="https://www.google.com/">
<input type="hidden" value="auth-token" />
<button mat-button color="primary" type="submit" (click)="form.submit()">Submit</button>
<input type="submit" value="Submit" />
</form>
Related Topics
Saving Images in Database MySQL
Enabling 'Strict_Types' Globally in PHP 7
Pdoexception "Could Not Find Driver" in PHP
How Does PHP Compare Strings with Comparison Operators
File_Get_HTML Displays Fatal Error Call to Undefined Function
Undefined Index with PHP Sessions
Process Mathematical Equations in PHP
Backreference Does Not Work in PHP
Undefined Index While Uploading File
How to Pass an Array Using PHP & Ajax to JavaScript
MySQL Query Result in PHP Variable
Capture Newline from a Textarea Input