0

当我单击提交按钮时,我对如何弹出一个新窗口有疑问。到目前为止,我有以下代码:

<form action="printstockin.php" name="sumary" method="post"
 onsubmit="return confirm(
       'Are you sure you want to clear this sale? All items will cleared.')" >

此代码显示一个带有是和否选项的警报框。我希望当我单击“是”时它应该会弹出一个新窗口。我尝试了不同的东西,但无法得到我想要的东西。

4

3 回答 3

0

onsubmit =" if (confirm('您确定要清除此销售吗?所有项目都将清除。'))window.open(URL,name,specs,replace)

于 2013-09-21T12:16:24.330 回答
0

尝试这个

脚本-

function disp_confirm()
{
 var r=confirm("Are you sure you want to clear this sale? All items will cleared.?")
 if (r==true)
 {
   window.open("http://www.google.com")
 }
 else
 {
  return false;
 }
}

HTML -

<form action="printstockin.php" name="sumary" method="post" onsubmit="disp_confirm()" >
于 2013-09-21T12:40:03.350 回答
0

就放

target="_blank"

属性到您的表单标签:

<form action="printstockin.php" name="sumary" method="post" onsubmit="return confirm('Are you sure you want to clear this sale? All items will cleared.')" target="_blank">
于 2013-09-21T12:09:24.100 回答