问题描述:
有2个页面:
页面1(gzxz.jsp工作类别选择页面)
页面2(gznr.jsp工作内容页面)
实现效果:
通过"工作类别选择"页面选择工作类别"工作1"或"工作2",点击"下一步"按钮,跳转到页面2,即工作内容页面;
要求:当选择"工作1"时要求,跳转至页面2后只显示"工作1"表格中的表格项
     当选择"工作2"时要求,跳转至页面2后只显示"工作2"表格中的表格项
备注:
识别单选框的选择状态,通过jquery实现页面2中"工作1"和"工作2表格"的隐藏及显示.
***************************************************************************
以下是页面1和页面2的部分代码:
页面1:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
</head><body>
<p>&nbsp;</p>
<form id="form1" name="form1" method="post" action="">
  <p>当天工作选择:</p>
  <table width="200" border="1">
    <tr>
      <th scope="row"><label>
        <input name="radiobutton" type="radio" value="radiobutton" />
      </label></th>
      <td>工作1</td>
    </tr>
    <tr>
      <th scope="row"><label>
        <input name="radiobutton" type="radio" value="radiobutton" />
      </label></th>
      <td>工作2</td>
    </tr>
    <tr>
      <th scope="row">&nbsp;</th>
      <td><label>
        <input type="submit" name="Submit" value="下一步" />
      </label></td>
    </tr>
  </table>
  <p>&nbsp;  </p>
</form>
<p>&nbsp; </p>
</body>
</html>页面2:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
</head><body>
<form id="form1" name="form1" method="post" action="">
  <p>填写工作内容:</p>
  <p>工作1:</p>
  <table width="200" border="1">
    <tr>
      <th width="23" scope="row">工作一名称:</th>
      <td width="161"><label>
        <input type="text" name="textfield" />
      </label></td>
    </tr>
    <tr>
      <th scope="row">工作内容</th>
      <td><label>
        <textarea name="textarea"></textarea>
      </label></td>
    </tr>
  </table>
  <p>工作2:</p>
  <table width="200" border="1">
    <tr>
      <th width="23" scope="row">工作二名称:</th>
      <td width="161"><label>
        <input type="text" name="textfield2" />
      </label></td>
    </tr>
    <tr>
      <th scope="row">工作内容</th>
      <td><label>
        <textarea name="textarea2"></textarea>
      </label></td>
    </tr>
  </table>
  <p>
    <label>
    <input type="submit" name="Submit" value="提交" />
    </label>
  </p>
  <p>&nbsp;</p>
  <p>&nbsp;  </p>
</form>
</body>
</html>

解决方案 »

  1.   

    楼主你这种写法是要经过后台的,你可以把第一个页面的radio传到第二个页面的,到时候用java语言来判断就可以了
    不需要用jq呀
      

  2.   

    不要想的那么复杂,直接跳转的时候url?argsName='value'把单选的value传递过去,你直接request.getParameter(argsName)获取到之后进行判断就行了。
      

  3.   

     $.get("目标url",{id:id,num:num},function(data){
            .....你的操作
     });
    第二个就是参数