当前位置: 代码迷 >> Java Web开发 >> 看看小弟我的代码是不是异常 请
  详细解决方案

看看小弟我的代码是不是异常 请

热度:639   发布时间:2016-04-17 17:15:11.0
看看我的代码是不是错误 请高手指点
<%@   page   language= "java "   contentType= "text/html;charset=gb2312 "%>
<form   method= "post "   name= "form3 ">      
      <tr>
            <td>
              <input   name= "ddfind "   type= "radio "   value= "订单查询 "   checked= "checked "   id= "2 "   /> 订单查询&nbsp;&nbsp;&nbsp;
              <input   name= "ddfind "   type= "radio "   value= "合同查询 "   id= "3 "/> 合同查询
              </td>
        </tr>
</form>
<script   language= "JavaScript ">
  var   ff   =   document.form3;
  if(ff.2.checked= "checked "){
<%@   include   file= "zy_info_10.jsp "   %>
  }
  if(ff.3.checked= "checked ")
  {
  <%@   include   file= "contract_search.jsp "%>
  }
</script>

------解决方案--------------------
怎么能在客户端操作服务端对象呢?改成这样的
<%@ page language= "java " contentType= "text/html;charset=gb2312 "%>
<form method= "post " name= "form3 " action= "action.asp "> /**提交到action*/
<tr>
<td>
<input name= "ddfind " type= "radio " value= "订单查询 " checked= "checked " id= "2 " /> 订单查询&nbsp;&nbsp;&nbsp;
<input name= "ddfind " type= "radio " value= "合同查询 " id= "3 "/> 合同查询
</td>
</tr>
</form>

action.jsp
<%
String nowValue=request.getParameter( "ddfind "); //取得ddfind的值
String tempFile=nowValue.equals( "订单查询 ")? "zy_info_10.jsp ": "contract_search.jsp ";
response.sendRedirect tempFile;
%>
------解决方案--------------------
支持
  相关解决方案