我想创建一个打开新窗口的脚本,在该窗口中有一个要调用的表单。我想只是从新窗口调用表单并返回。
我的代码:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function launchproducts (form) {
var input_from_user = form.inputbox.value;
for ( var i = 0; i < input_from_user ; i++) {
var launch_code = "http://example.com";
window.open(launch_code, '_blank');
document.forms[2].submit();
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="" METHOD="GET">Enter product numbers: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT TYPE="button" NAME="button" Value="Click" onClick="launchproducts(this.form)">
</FORM>
</BODY>
</HTML>