By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,067 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,067 IT Pros & Developers. It's quick & easy.

how to Open new tab after click on submit button

P: 1
How can i open this link in new tab after click on submit buton

Expand|Select|Wrap|Line Numbers
  1. <td
  2. <input name="submit_btn" class="btn btn-primary" id="btn3" value="Appointment Login" onclick="document.OnlineForm.action = 'ReprintAppt.jsp'" type="submit"> </div> </td>
Dec 21 '15 #1
Share this Question
Share on Google+
3 Replies


100+
P: 300
You can accomplish this by using <form>..</form>.

Expand|Select|Wrap|Line Numbers
  1. <form action="http://www.yourSite.com/yourPage" method="get" target="_blank">
  2.     <input type="submit" value="submit" />
  3. </form>
Dec 21 '15 #2

P: 18
Hey,apply this code if you want to open new tab on click of submit button:
Expand|Select|Wrap|Line Numbers
  1. <form id="myForm" name="test-1" action="test3.php" method="post">
  2. <input name="fname"><input name="lname"><br>
  3.  
  4. <input value="Save" name="save" type="button" onclick="submitForm('test3.php','_self');">
  5. <input value="Nwindow" name="nwindow" type="button" onclick="submitForm('test2.php','_blank');">
Jan 13 '16 #3

P: 29
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3.  
  4. <h1>click on submit button</h1>
  5.  
  6. <form action="/action_page.php" method="get" target="_blank">
  7.   <label for="fname">First name:</label>
  8.   <input type="text" id="fname" name="fname"><br><br>
  9.   <label for="lname">Last name:</label>
  10.   <input type="text" id="lname" name="lname"><br><br>
  11.   <input type="submit" value="Submit">
  12. </form>
  13. </body>
  14. </html>
May 25 '20 #4

Post your reply

Sign in to post your reply or Sign up for a free account.