How to open a new window on form submit

后端 未结 9 1959
说谎
说谎 2020-11-29 22:36

I have a submit form and want it to open a new window when users submits the form so i can track it on analytics.

Here is the code I\'m using:



        
9条回答
  •  盖世英雄少女心
    2020-11-29 23:20

    In a web-based database application that uses a pop-up window to display print-outs of database data, this worked well enough for our needs (tested in Chrome 48):

    The trick is to match the target attribute on the tag with the second argument in the window.open call in the onsubmit handler.

提交回复
热议问题