Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2014
    Thanked 0 Times in 0 Posts

    Open in new window

    Does anyone know how I can make this button code open in a new tab?

    <form><input type="button" value="Apply Now" onClick="window.location.href='https://adobeformscentral.com/?f=fghhfdykjed343#'"> </form>

  2. #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 932 Times in 919 Posts
    If your visitor has their browser set to open new sites in a new tab then the code you have will do it. Alternatively if you replace the window.location.href with a call to window.open() passing the address to it then that will open in a new tab if your visitor has their browser set to use a new tab instead of a new window. There is no command that will specify to open in a new tab as since 1997 where pages open has been specified as being up to the browser owner and browsers back then didn't have tabs.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts