<script language=javascript>
function shai() //筛选{var SS=document.getElementById("select").value;
var S_local=document.getElementById("select_local").value;
var S=document.getElementById("S").value;
//document.getElementById("ok").value="/e/action/ListInfo.php?classid=4&ph=1&"+SS+"="+encodeURI(S)+"&local="+encodeURI(S_local);
window.location="/e/action/ListInfo.php?classid=4&ph=1&"+SS+"="+encodeURI(S)+"&local="+encodeURI(S_local);}
</script><select id="select_local" style="position:relative;left:-2px;top:2px;height:24px;font-weight:bold;">
    <option value="">地区</option>
    <option value="国内">国内</option>
    <option value="境外">境外</option>
  </select>
<select id="select" style="position:relative;left:-2px;top:2px;height:24px;font-weight:bold;">
    <option value="ids">序号</option>
   <option value="status">状态</option>
  </select>
  <input type="text" id="S" style="font-weight:bold;width:100px;height:20px;border: 1px solid #999999;"/>
&nbsp;&nbsp;<a href="#" onClick="shai()"/><b>提交</b></a>
&nbsp;&nbsp;<a href="/e/action/ListInfo.php?classid=4"/><b>全部</b></a>我想要实现比如筛选 【国内】-【状态】-“正常”的数据,点击提交,就访问
/e/action/ListInfo.php?classid=4&ph=1&status=正常&local=国内但问题是第一次点击了好使,打开访问页面后,再筛就不好使了。

解决方案 »

  1.   

    访问页面
    var SS=document.getElementById("select").value;
    var S_local=document.getElementById("select_local").value;
    var S=document.getElementById("S").value;这些对象是不是存在
      

  2.   

    在你的URL后面加入一个随机值。搞定。Math.random();
      

  3.   

    <a href="#" onClick="shai()"/><b>提交</b></a>
    &nbsp;&nbsp;<a href="/e/action/ListInfo.php?classid=4"/><b>全部</b></a>应该这么写:&nbsp;&nbsp;<a href="#" onClick="shai()"><b>提交</b></a>
    &nbsp;&nbsp;<a href="/e/action/ListInfo.php?classid=4"><b>全部</b></a>另外建议尽量别这么提交,最好用form提交,虽然你转码了,还是容易出现乱码。
      

  4.   

    var SS=document.getElementById("select").value;
    var S_local=document.getElementById("select_local").value;
    上面这样获取不到select的值,这样来获取试试
    document.getElementById("select").options[document.getElementById("select").options.selectedIndex].value;
      

  5.   

    var SS=document.getElementById("select").value;
    第一次提交没变,第二次到这个页面的时候S发生变化
    window.location="/e/action/ListInfo.php?classid=4&ph=1&"+SS+"="+encodeURI(S)+"&local="+encodeURI(S_local);
    /e/action/ListInfo.php?classid=4&ph=1&status=正常&local=国内
    你的SS=status  会不会第二次变成其他的呢 如SS=stat