1. <small id='vDtMe'></small><noframes id='vDtMe'>

    <i id='vDtMe'><tr id='vDtMe'><dt id='vDtMe'><q id='vDtMe'><span id='vDtMe'><b id='vDtMe'><form id='vDtMe'><ins id='vDtMe'></ins><ul id='vDtMe'></ul><sub id='vDtMe'></sub></form><legend id='vDtMe'></legend><bdo id='vDtMe'><pre id='vDtMe'><center id='vDtMe'></center></pre></bdo></b><th id='vDtMe'></th></span></q></dt></tr></i><div id='vDtMe'><tfoot id='vDtMe'></tfoot><dl id='vDtMe'><fieldset id='vDtMe'></fieldset></dl></div>

  2. <tfoot id='vDtMe'></tfoot>
  3. <legend id='vDtMe'><style id='vDtMe'><dir id='vDtMe'><q id='vDtMe'></q></dir></style></legend>

    • <bdo id='vDtMe'></bdo><ul id='vDtMe'></ul>

    1. 不同国家、州、地理位置的动态下拉列表?

      Dynamic drop down list for different countries, states, geographic locations?(不同国家、州、地理位置的动态下拉列表?)

    2. <legend id='vJZHi'><style id='vJZHi'><dir id='vJZHi'><q id='vJZHi'></q></dir></style></legend>

        <bdo id='vJZHi'></bdo><ul id='vJZHi'></ul>

            <i id='vJZHi'><tr id='vJZHi'><dt id='vJZHi'><q id='vJZHi'><span id='vJZHi'><b id='vJZHi'><form id='vJZHi'><ins id='vJZHi'></ins><ul id='vJZHi'></ul><sub id='vJZHi'></sub></form><legend id='vJZHi'></legend><bdo id='vJZHi'><pre id='vJZHi'><center id='vJZHi'></center></pre></bdo></b><th id='vJZHi'></th></span></q></dt></tr></i><div id='vJZHi'><tfoot id='vJZHi'></tfoot><dl id='vJZHi'><fieldset id='vJZHi'></fieldset></dl></div>

                <small id='vJZHi'></small><noframes id='vJZHi'>

                <tfoot id='vJZHi'></tfoot>
                  <tbody id='vJZHi'></tbody>
                本文介绍了不同国家、州、地理位置的动态下拉列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我让我的用户输入他们的城市、州和国家.但我的困境是如何动态管理它,以便我可以在正确拼写和格式的同时控制输入的内容.

                I am having my users to enter their city, state, and country. But my dilemma is how to manage it dynamically so that I can control what is entered while having correct spelling and formatting.

                例如,我目前为每个州都有一个静态下拉列表.

                For instance, I currently have a static drop down for each state.

                <select>
                     <option name="state" value="AL">Alabama</option>
                     <option name="state" value="AK">Alaska</option>
                     <option name="state" value="AZ">Arizona</option>
                     <option name="state" value="AR">Arkansas</option>
                     <option name="state" value="CA">California</option>
                     ....
                 </select>
                

                这显然工作正常,但如果用户不在美国,则根本无法扩展.它在不同的国家和城市方面也存在不足.我曾想过使用文本字段,然后将它们保存在一个单独的数据库中,并使用 JQuery 自动完成插件来生成列表,但这似乎不是最好的方法.

                This works fine obviously, but doesn't scale at all if the user is outside the US. It also falls short in regards to different countries and cities. I have thought of using text fields, then saving them in a separate database and using the JQuery autocomplete plugin for generating the list but it doesn't seem like the best way to do it.

                推荐答案

                好的,几个小时后我写了一个基于 MySQL 世界数据库的应用程序:MySQL 世界设置

                Ok so after several hours I've written an application based on the MySQL world database: MySQL world Setup

                整个应用程序的代码太大了,无法给出答案,因此我将为每个单独的文件提供 Pastebin 链接,以及指向脚本工作示例的链接和 Zip 存档的下载链接.

                The code for the entire application is way to large to put in an answer so I'll provide Pastebin links for each seperate file, aswell as a link to a working example of the script and a download link for the Zip archive.

                我确信代码可以进一步改进,但我会把它留给你.

                I'm sure the code can be improved further, but I'll leave that up to you.

                要求:MySQL世界数据库/jQuery

                Requirements: MySQL world Database / jQuery

                1. index.html:index.html
                2. style.css:style.css
                3. country.js:country.js
                4. dbconnect.php:dbconnect.php
                5. get_country.php:get_country.php
                6. get_states.php:get_states.php
                7. get_city.php:get_city.php
                8. get_data.php:get_data.php

                工作示例:

                1. 国家、州、城市选择器

                Zip 存档下载(不包括数据库!):

                1. selector.zip(目前已关闭)
                2. 以上文件的病毒>
                1. selector.zip (currently down)
                2. Virus Total Analysis of above file

                由于对这个问题的普遍要求,我正在编写更新的脚本.很快就会添加.

                I'm working on an updated script due to the popular demands on this question. It will be added soon.

                这篇关于不同国家、州、地理位置的动态下拉列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                get a # from a url in php(从 php 中的 url 获取 #)
                PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

                  <legend id='TjtqI'><style id='TjtqI'><dir id='TjtqI'><q id='TjtqI'></q></dir></style></legend>
                    <bdo id='TjtqI'></bdo><ul id='TjtqI'></ul>

                    1. <small id='TjtqI'></small><noframes id='TjtqI'>

                        <tbody id='TjtqI'></tbody>
                      <tfoot id='TjtqI'></tfoot>

                    2. <i id='TjtqI'><tr id='TjtqI'><dt id='TjtqI'><q id='TjtqI'><span id='TjtqI'><b id='TjtqI'><form id='TjtqI'><ins id='TjtqI'></ins><ul id='TjtqI'></ul><sub id='TjtqI'></sub></form><legend id='TjtqI'></legend><bdo id='TjtqI'><pre id='TjtqI'><center id='TjtqI'></center></pre></bdo></b><th id='TjtqI'></th></span></q></dt></tr></i><div id='TjtqI'><tfoot id='TjtqI'></tfoot><dl id='TjtqI'><fieldset id='TjtqI'></fieldset></dl></div>