如何在新窗口中打开链接

时间:2019-05-31 09:44:51

标签: php

早上好 如何在新窗口中打开操作“ URLPAYPAL”调用的链接?我尝试了onclick =“ window.open();但这没用

echo "<a href=# class=\"btn btn-lg btn-block btn-inverse\" onclick=\"";
echo "formid = document.getElementById('gest');\n";
echo "document.getElementById('tabdati2').style.display='';\n";
echo "document.getElementById('tabdati1').style.display='none';\n";
echo "document.getElementById('gest').action='" . URLPAYPAL . "';\n";
echo "formid.email.style.backgroundColor ='#FFFFFF';\n";
echo "var ctrlerr = 0;\n";
echo "var regtel = /^(\d+)$/;\n";
echo "var regema =  /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/;\n";
echo "if ((formid.cli.value) != (formid.cli2.value)) {\n";
echo "formid.cli.style.backgroundColor ='#E55B3C';\n";
echo "alert ('Il numero di telefono non coincide!');\n";
echo "ctrlerr=1;\n";
echo "}\n";
echo "if ((formid.cli.value == '') || (formid.cli.value == 'Numero di telefono')) {\n";
echo "formid.cli.style.backgroundColor ='#E55B3C';\n";
echo "alert ('Scrivi il numero di telefono!');\n";
echo "ctrlerr=1;\n";
echo "}\n";
echo "if(!ctrlerr) {\n";
echo "formid.submit();\n";
echo "}\n";
echo "\"> Ricarica<span class=\"fui-arrow-right\"></span> </a>\n";

2 个答案:

答案 0 :(得分:0)

您可以执行以下操作

window.open(url, '_blank');

答案 1 :(得分:0)

您可以将此添加到表单

target="_blank"