去别人的网站上看了一下多条件筛选提交,原来实现原理就这几句代码就ok了,后台进行字段查询,实现功能思路正确很重要.
key:<input type="text" id="key_1"><br/>
key2:<select id="key_2">
<option value="1">op1</option>
<option value="2">op2</option>
<option value="3">op3</option>
</select>
<p>
<button onclick="sub()">提交</button>
</p>
<script type="text/javascript" src="__INDEX__/js/jquery.min.js"></script>
<script>
function sub(){
//构建url
var getUrl = '/index.php/index/News/xx/key1/key1_value/key2/key2_value.html';
//替换字段
getUrl=getUrl.replace("key1_value",$("#key_1").val());
getUrl=getUrl.replace("key2_value",$("#key_2").val());
//跳转
location.href=getUrl;
}
</script>