3

I have create one jsp page which contain one html form while submitting this form on that time i want to open it in new tab in same browser.

Luiggi Mendoza
  • 83,472
  • 15
  • 149
  • 315
Panchotiya Vipul
  • 1,116
  • 5
  • 15
  • 41

2 Answers2

10

You can use :

<form method="post" target="_blank">
    //Your other code

    <input type="submit" name="btn_submit" id="btn_submit" value="Submit">
</form>

This will open page in new tab. _blank is used for that.

You can also visit this for more details about it.

**

OR

**

<input type="button" value="Open Window" onclick="window.open('http://www.domain.com')"> 

**

OR

**

onclick="window.location.href='http://www.domain.com/','_blank'";
Java Curious ღ
  • 3,412
  • 8
  • 37
  • 61
0

try out this..

<form method="post" target="_blank">

    // form input fields goes here...

    <input type="submit" name="btnSubmit" id="btnSubmit" value="Submit">
</form>

Note: You can add action to form where you want to send your request.

Vijay
  • 7,651
  • 9
  • 41
  • 69