About SELECT unlimited level (province | City | County | Township | Village | ...)

xiaoxiao2021-03-06  60

Author: shocknet

Index.asp

code:

</ title></p> <p><meta content = "text / html; charSet = GB2312" http-equiv = "content-type"></p> <p><style type = "text / css"> <! -</p> <p>FONT {font-size: 12px}</p> <p>Td {font-size: 12px}</p> <p>A {color: # 333399}</p> <p>A: hover {color: # ff6600}</p> <p>-> </ stop></p> <p><script language = "javascript" type = "text / javascript"> <!</p> <p>Function funonload () {</p> <p>Document.all.list_file.src = "jscript_city.asp? base = 0 & sele = 0- & elem = SELECT01";</p> <p>}</p> <p>/ / PBASE series, based on 0 bases,</p> <p>// psele is the value value of <Option</p> <p>// pele is the next level of form name</p> <p>Function CHGSELECT (PBASE, PSELE, PELEM) {</p> <p>// After changing a list. Clear the value of the later list.</p> <p>For (i = parseint (pelem.replace ("SELECT", ")); i <= 5; i ) {</p> <p>VAR TMP = "000" i;</p> <p>Var pelem1 = evAl ("Document.form1.select" Tmp.Substr (Tmp.Length-2));</p> <p>Pelem1.Length = 1;</p> <p>Pelem1.selectedIndex = 0;</p> <p>}</p> <p>// js gets the database data of the database with ASP to update the next list</p> <p>Document.all.list_file.src = "jscript_city.asp? base =" PBASE "& sele =" PSELE "& ELEM =" pelem;</p> <p>}</p> <p>// -> </ script></p> <p><script id = "List_file" language = "javascript" type = "text / javascript" src = "> </ script></p> <p></ hEAD></p> <p><body bgcolor = "# ffffff" leftmargin = "0" TopMargin = "2" text = "# 333333" οnlοad = "funonLoad ();"></p> <p><form name = "form1"></p> <p><select name = "SELECT01" οNCHANGE = "chgselect (1, this.Options [this.selectedIndIndex] .value, 'select02')></p> <p><option value = ""> Province ... </ option> </ select></p> <p><select name = "SELECT02" οNCHANGE = "chgselect (2, this.Options [this.selectedIndIndex] .value, 'select03')"></p> <p><option value = ""> city ... </ option></p> <p></ select></p> <p><select name = "SELECT03" οNCHANGE = "chgselect (3, this.Options [this.selectedIndIndex] .value, 'SELECT04')>></p> <p><option value = "> counties ... </ option></p> <p></ select></p> <p><select name = "SELECT04" οNCHANGE = "chgselect (4, this.Options [this.selectedIndIndex] .value, 'SELECT05')>></p> <p><option value = "> Township ... </ option></p> <p></ select></p> <p><select name = "SELECT05"></p> <p><option value = "> village ... </ option></p> <p></ select></p> <p></ form></p> <p></ body> </ html></p> <p>'jscript_city.asp</p> <p>code:</p> <p><%</p> <p>'Varbase drop-down menu level</p> <p>'Varsele Select the Database ID of the drop-down menu item</p> <p>'Varelem's list of forms</p> <p>Varbase = Request.QueryString ("Base")</p> <p>Varsele = Left (Request.QueryString ("Sele"), INSTR (Request.QueryString ("SELE"), "-") - 1)</p> <p>VareLem = Request.QueryString ("ELEM")</p> <p>VARDistName = ""</p> <p>Varautoid = ""</p> <p>SET CONDB = Server.createObject ("AdoDb.Connection")</p> <p>Condb.open "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & server.mappath ("db1.mdb")</p> <p>Sqlcommand = "SELECT * from table1 where filed1 =" & varbase & "and filed2 =" & varsele</p> <p>Set xicord = cond.execute (SQLCommand)</p> <p>While Not RsRecord.eof</p> <p>VardistName = VARDISTNAME & CHR (34) & RSRecord ("Filed3") & chr (34)</p> <p>Varautoid = Varautoid & Chr (34) & RSRecord ("ID") & chr (34) rsrecord.movenext</p> <p>IF not rsrecord.eof kil</p> <p>VardistName = VARDISTNAME & ","</p> <p>Varautoid = Varautoid & "</p> <p>END IF</p> <p>Wend</p> <p>Response.write ("VAR VARDISTNAME = New Array (" & VARDISTNAME & ")" & VBCRLF)</p> <p>Response.write ("VAR VARAUTOID = New Array (" & Varautoid & ")" & VBCRLF)</p> <p>Response.write ("VAR VARELEM = EVAL (" & Chr (34) & "Document.form1." & VareLem & Chr (34) & ")" & VBCRLF)</p> <p>Response.write ("VareLem.Length = VARDISTNAME.LENGTH 1;" & VBCRLF)</p> <p>Response.write ("for (var i = 0; i <vardistname.length; i ) {" & vbcrlf)</p> <p>Response.write ("VareLem.Options [i 1] .text = VARDISTNAME</p> <p>"& VBCRLF) Response.write (" Varelem.Options [i 1] .Value = VARAUTOID '-' VARDISTNAME; "& VBCRLF) Response.write ("} "& vbrlf) response.write (" VareLem.SelectedIndex = 0; "& VBCRLF)%></p> <p>db1.mdb</p> <p>'-------------------------------------</p> <p>Fujian Xiamen Si Ming Huang Yu Zengyi Eucalyptus Village</p> <p>Fujian Quanzhou Fengze West Lake Water Village</p> <p>As the five-level transfer database above:</p> <p>'-------------------------------</p> <p>ID filed1 filed2 filed3</p> <p>1 0 0 Fujian</p> <p>2 1 1 Xiamen</p> <p>3 1 1 Quanzhou</p> <p>4 2 2 Siming</p> <p>5 3 4 yellow</p> <p>6 4 5 Zeng Yun Village</p> <p>7 2 3 Fengze</p> <p>8 3 7 West Lake</p> <p>9 4 8 Water Village</p> <p>'-------------------------------------</p> <p>Database description:</p> <p>ID automatic number</p> <p>Filed1 drop-down menu list (number of grades. You can set it. It is a digital type)</p> <p>FILED2 ID number (with long integer)</p> <p>Filed3 doesn't have to say it (file. Length yourself)</p> <p>This program passes the IIS4 WIN2000P Access 2000.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-84515.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="84515" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.047</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'xqdR9Rrn7dK2yKTlrodJ8yVkYuPKT1ve_2BKDh_2FZplNPkrDZwOg2RqSf4uMmyDml6mtoZcvTvl_2B9Z_2B_2FUtgQpX5Yg_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>