php javascript 三级联动 bind得不到值,地区三级联动筛选

第一步:3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

后台添加三个数据表字段3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

字段名:pro   字段标识:省    输入表单替换html代码:  3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

字段名:city  字段标识:市    输入表单替换html代码:3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

字段名:area  字段标识:县    输入表单替换html代码:3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

第二步:3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

建立完毕后,在到 管理系统模型  修改生成相应的表单!3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

三个字段设为 提交项 可添加 修改   列表显示  结合项3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

第三步:3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

打开e/admin/AddNews.php3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

把以下代码粘贴到  结尾的随便位置即可3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var s = selects;3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//获取对象3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var p = document.getElementsByName('pro')[0];//省3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var c = document.getElementsByName('city')[0];//市3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var a = document.getElementsByName('area')[0];//区3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//绑定数据3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.bind(p,province);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.bind(c,city);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.bind(a,area);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//确定从属关系3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.parent(p,c);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.parent(c,a);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//设置默认值3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.selected(p,{value:'<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($r[pro]))?>'});3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.selected(c,{value:'<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($r[city]))?>'});3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.selected(a,{value:'<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($r[area]))?>'});3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

第四步:3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

下载附件两个JS上传到e/admin/   JS为UTF-8编码,其他请自己转码3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

到此后台已经实现添加内容三级联动3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

在前台显示位置添加一下代码可筛选查3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var s = selects;3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//获取对象3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var p = document.getElementsByName('pro')[0];//省3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var c = document.getElementsByName('city')[0];//市3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

var a = document.getElementsByName('area')[0];//区3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//绑定数据3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.bind(p,province);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.bind(c,city);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.bind(a,area);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//确定从属关系3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.parent(p,c);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.parent(c,a);3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

//设置默认值3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.selected(p,{value:'<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($r[pro]))?>'});3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.selected(c,{value:'<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($r[city]))?>'});3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

s.selected(a,{value:'<?=$ecmsfirstpost==1?"":htmlspecialchars(stripSlashes($r[area]))?>'});3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

注意两个JS路径3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

住:四个默认字段mid是模型ID,classid是栏目ID,tempid是列表所使用的模板标签ID,ph是结合项,ph参数是必须等于1的,表示使用结合项,否则不能筛选3x9丁合超的个人博客 - 分享网络技术和网络热点的互联网科技博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值