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.

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

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

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <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>