需要帮助修改这个javascript,在提交/发布时打开一个新窗口

时间:2010-05-04 18:09:56

标签: javascript jquery

我有一个表单,一旦您从下拉列表中选择并选择提交,就会打开一个新窗口

这是当前页面上的代码,我认为它需要完全删除或修改,它只适用于IE和Firefox

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> 
//<!-- Hide JavaScript from older browsers 
//  Function to open a window
function windowOpen(window_url) {
   helpWin = window.open(window_url,'','toolbar=yes,status=no,scrollbars=yes,menubar=yes,resizable=yes,directories=no,location=no,width=350,height=400');
   if (document.images) { 
       if (helpWin) helpWin.focus()
   }
}
//  End script hiding --> 
</SCRIPT>

<FORM ACTION="/pls/prod/zp_process_sm_payment.pz_process_sm_payment" METHOD="POST"> 

<TABLE  CLASS="dataentrytable" SUMMARY="This table allows
                                                the user to select a
                                                valid term for
                                                registration
                                                processing."> 
<TR> 
<TD CLASS="delabel" scope="row" >Select a Term: </TD> 
<TD CLASS="dedefault"> 
<LABEL for=term_id><SPAN class=fieldlabeltextinvisible>Term</SPAN></LABEL> 
<SELECT NAME="term_in" SIZE="1" ID="term_id"> 
<OPTION VALUE="201040">Fall 2010
<OPTION VALUE="201030">Summer 2010
<OPTION VALUE="201020">Spring 2010
<OPTION VALUE="201010">Winter Mini 2010 (View only)
<OPTION VALUE="200940">Fall 2009 (View only)
<OPTION VALUE="200930">Summer 2009 (View only)
<OPTION VALUE="200920">Spring 2009 (View only)
<OPTION VALUE="200910">Winter Mini 2009 (View only)
<OPTION VALUE="200840">Fall 2008 (View only)
<OPTION VALUE="200830">Summer 2008 (View only)
<OPTION VALUE="200820">Spring 2008 (View only)
<OPTION VALUE="200810">Winter Mini 2008 (View only)
<OPTION VALUE="200740">Fall 2007 (View only)
<OPTION VALUE="200730">Summer 2007 (View only)
<OPTION VALUE="200720">Spring 2007 (View only)
<OPTION VALUE="200710">Winter Mini 2007 (View only)
<OPTION VALUE="200640">Fall 2006 (View only)
</SELECT> 
</TD> 
</TR> 
<TR> 
<TD COLSPAN="11" CLASS="deseparator">&nbsp;</TD> 
</TR> 
</TABLE> 
<INPUT TYPE="submit" VALUE="Submit"> 
</FORM>

1 个答案:

答案 0 :(得分:1)

提交表单(在同一页面上)后,您将失去对页面的控制权。浏览器等待加载新页面时,JavaScript执行停止。

您需要先打开新窗口,然后提交表单。

如果没有看到您表单的代码,我不确定这是不是问题。