我在帝国居然上传不了附件!JS文件已封装,需要请到我这里下载http://xiu100.com/bbs/viewthread.php?tid=3065&page=1&extra=page%3D1 在你要加入省市区联动选择的的系统模型-管理系统模型-修改-在录入表单模板的首行加入如下代码: <SCRIPT LANGUAGE = JavaScript> <!-- //** Power by Fason(2004-3-11) //** Email:fason_pfx@hotmail.com
var s=["province","city","area"] function setup() { for(i=0;i<s.length-1;i++) document.getElementById(s[i]).onchange=new Function("change("+(i+1)+")"); change(0); } function show(){ document.add.district.value= document.getElementById('province').options[document.getElementById('province').selectedIndex].value + "-" + document.getElementById('city').options[document.getElementById('city').selectedIndex].value + "-" + document.getElementById('area').options[document.getElementById('area').selectedIndex].value; } //--> </SCRIPT> <script language="javascript" src="http://127.0.0.1:808/PCASClass.js"></script> 红色那里替换为你自己获取选择结果的字段代码 蓝色那里看你把JS文件放到哪个路径就填哪个,js文件下面有下载 然后还是在该录入模板中,找到你获取选择结果的字段名称,例如我的 <tr><td width=16% height=25 bgcolor=ffffff>所在地区</td><td bgcolor=ffffff>[!--district--] <fieldset style="padding:5px;"> <legend>省市区选择</legend> 请依次点选: <select name="province"></select> <select name="city"></select> <select name="area" onchange="show();"></select><br> </fieldset> <script language="javascript" defer>
new PCAS("province","city","area","请选择省","请选择市","请选择区县"); new PCAS("province1","city1","area1","吉林省","吉林市","龙潭区"); new PCAS("province2","city2","area2","江苏省","苏州市","沧浪区");
new PCAS("province3","city3","area3"); new PCAS("province4","city4","area4","江苏省"); new PCAS("province5","city5","area5","江苏省","苏州市"); new PCAS("province6","city6","area6","江苏省","苏州市","沧浪区"); </script> 红色那段就是我的,你找到后把红色那段下面的部分加入 然后再到系统设置-管理数据表-找到你的数据表-点管理字段-找到你获取选择结果的那个字段,修改,字段类型选字符型0-255,长度80,单行文本框 输入表单html代码填写<input name="district" type="text" id="district" size=60 value="<?=htmlspecialchars(stripSlashes($r[district]))?>"> 红色替换成你的字段 投稿表单那里也是一样 这样就可以了
|