right_down.jsp
=================================================================================
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %><%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title><script language = "JavaScript1.2">function contacts()
{
s_unit = "";
s_new = "";
s_del = "";
s_mod = "";
s_audit = "";
s_able = ""; var vcb_unit = document.getElementByName("unit");
var vcb_new = document.getElementsByName("add");
var vcb_del = document.getElementsByName("del");
var vcb_mod = document.getElementsByName("mod");
var vcb_audit = document.getElementsByName("audit");
var vcb_able = document.getElementsByName("able"); count_unit=vcb_unit.length;
count_new= vcb_new.length;
count_del= vcb_del.length;
count_mod= vcb_mod.length;
count_audit= vcb_mod.length;
count_able= vcb_able.length;
for(i=0;i< count_unit;i++)
{
 s_unit = s_unit + vcb_unit[i].value + "," ;
}
for(i = 0;i < count_new;i++)
            if(vcb_new[i].checked){
                    s_new = s_new + '1,';
            }else{
                    s_new = s_new + '0,';
            }
for(i = 0;i < count_del;i++)
            if(vcb_del[i].checked){
                    s_del = s_del + '1,';
            }else{
                    s_del = s_del + '0,';
            }
for(i = 0;i < count_mod;i++)
            if(vcb_mod[i].checked){
                    s_mod = s_mod + '1,';
            }else{
                    s_mod = s_mod + '0,';
            }
for(i = 0;i < count_audit;i++)
            if(vcb_audit[i].checked){
                    s_audit = s_audit + '1,';
            }else{
                    s_audit = s_audit + '0,';
            }
for(i = 0;i < count_able;i++)
            if(vcb_able[i].checked){
                    s_able = s_able + '1,';
            }else{
                    s_able = s_able + '0,';
            }
document.myform.new_str.value = s_new.substring(0,s_new.length);
document.myform.del_str.value = s_del.substring(0,s_del.length);
document.myform.mod_str.value = s_mod.substring(0,s_mod.length);
document.myform.audit_str.value = s_audit.substring(0,s_audit.length);
document.myform.able_str.value = s_able.substring(0,s_able.length);
document.myform.unit_str.value = s_unit.substring(0,s_unit.length); alert(document.myform.new_str.value + "[]" + document.myform.del_str.value + "[]" + document.myform.mod_str.value + "[]" + document.myform.audit_str.value + "[]" + document.myform.able_str.value + "[]" + document.myform.unit_str.value); //document.myform.submit();
return true;
}function xxx()
{
alert("aaaaaaa");
return false;
}
</script><style type="text/css">
<!--
@import url("../css/admin.css");
-->
</style>
</head>
<body><form name = "myform" action="../rightsubAction.do" method="post" onSubmit="return contacts();">
  <input type="hidden" name="unit_str" value="">
  <input type="hidden" name="new_str" value="">
  <input type="hidden" name="del_str" value="">
  <input type="hidden" name="mod_str" value="">
  <input type="hidden" name="audit_str" value="">
  <input type="hidden" name="able_str" value="">
  <!-- 当前登陆用户-->
  <input type="hidden" name="usercode" value="">
  <input type="hidden" name="action" value="list">
  <input type="hidden" name="userid" value="">
  <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="32" background="../images/ny_a_28.gif"><img src="../images/ny_a_27.gif" width="24" height="27"></td>
    <td width="200" background="../images/ny_a_28.gif" class="bai12 style1"> 用户权限分配</td>
    <td background="../images/ny_a_28.gif">&nbsp;</td>
  </tr>
</table>
  <table id="table1" width="95%"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#1555A3" bgcolor="dadada" style="border-collapse:collapse ">
      <tr height="24">
  <td width="12%" bgcolor="CBE2FF" height="24">模块名称</td>
      <td width="14%" bgcolor="CBE2FF">增加</td>
      <td width="15%" bgcolor="CBE2FF">删除</td>
      <td width="15%" bgcolor="CBE2FF">修改</td>
      <td width="16%" bgcolor="CBE2FF">审核</td>
      <td width="16%" bgcolor="CBE2FF">是否可用</td>
    </tr>
<logic:present name="rightList">
<logic:iterate id="rightBean" name="rightList">
    <tr>
       <td height="24"><bean:write name="rightBean" property="unitCode" />
         <input name="unit" type="hidden" value="<bean:write name="rightBean" property="unitCode"/>" > </td>       <logic:match name="rightBean" property="recNew" value="1">
        <td align="center" ><input name="add" type="checkbox" value="1" checked></td>
       </logic:match>
       <logic:match name="rightBean" property="recNew" value="0">
        <td align="center" ><input name="add" type="checkbox" value="0"></td>
       </logic:match>       <logic:match name="rightBean" property="recDel" value="1">
        <td align="center"><input name="del" type="checkbox" value="1" checked></td>
       </logic:match>
       <logic:match name="rightBean" property="recDel" value="0">
        <td align="center"><input name="del" type="checkbox" value="0"></td>
       </logic:match>       <logic:match name="rightBean" property="recModify" value="1">
        <td align="center"><input name="mod" type="checkbox" value="1" checked></td>
       </logic:match>
       <logic:match name="rightBean" property="recModify" value="0">
        <td align="center"><input name="mod" type="checkbox" value="0"></td>
       </logic:match>       <logic:match name="rightBean" property="recAudit" value="1">
        <td align="center"><input name="audit" type="checkbox" value="1" checked></td>
       </logic:match>
       <logic:match name="rightBean" property="recAudit" value="0">
        <td align="center"><input name="audit" type="checkbox" value="0" ></td>
       </logic:match>       <logic:match name="rightBean" property="able" value="1">
        <td align="center"><input name="able" type="checkbox" value="1" checked></td>
       </logic:match>
       <logic:match name="rightBean" property="able" value="0">
        <td align="center"><input name="able" type="checkbox" value="0" ></td>
       </logic:match>    </tr>
</logic:iterate>
</logic:present>
  </table>
<!--用户现有权限列表-->
</form>
</body>
</html>

解决方案 »

  1.   

    try use a submit button
    parent.frames["frame2"].document.form1.submit1.click()
      

  2.   


    parent.document.myframe2.document.form1.submit("XXX.asp")该语句在:myframe1连接页面的<SCRIPT>
    试下啦
      

  3.   

    up.
    调用form的submit()事件就行啦。或者调用submit按钮的click()也行。调用form的onsubmit()事件只能运行事件处理函数,不能完成表单的提交
      

  4.   

    我查过资料 说的是 调用submit()函数不能触发 onSubmit()事件?