常用的php列表多条件筛选功能,前后台一起实现 后台对接可以拼接sql语句,通过表单值隐藏值筛选
表单筛选核心函数
function Filter(a, b) {
var $ = function(e) {
return document.getElementById(e);
}
var ipts = $('filterForm').getElementsByTagName('input'), result = [];
for (var i = 0, l = ipts.length; i
if (ipts[i].getAttribute('to') == 'filter') {
result.push(ipts[i]);
}
}
if ($(a)) {
$(a).value = b;
for (var j = 0, len = result.length; j
if (result[j].value == '' || result[j].value == '0') {
result[j].parentNode.removeChild(result[j]);
}
}
document.forms['filterForm'].submit();
}
return false;
}
本实例源码下载: