Using ASP nesting Js+sql server to create a two-level continuous drop-down box (i)

Source: Internet
Author: User
Tags sql table name
Js|server| pull Down

Using ASP nesting Js+sql server to build two-level continuous Drop-down box (1)

With the rapid development of network technology, more and more e-commerce sites have emerged. And in the construction of a powerful E-commerce site often do not have to provide online registration function to customers to register this module, in order to be as convenient as possible to fill out information customers, we often use the dropdown box for customers to choose, especially the two-level continuous drop-down box is most commonly used.

Moreover, I found today CSDN forum often have netizens ask this question, that is, need a two-level link Drop-down box, the first display province name, the second display corresponding city name. In order to answer this question, I write this article specially, hoped can be helpful to the netizen who needs this aspect information.

First, we first design the database (SQL Server 7.0)

Database name: Db_provincecat

Table name: 1) tb_province 2) tb_city

Description: The table tb_province is used to store the province name, and the table tb_city is used to store the corresponding city name.

Design of field names

1 The fields in table Tb_province have the province ID number (Provincecatid), the Province Code (provincecode), the province name (provincename), and table 1 gives the example:

Provincecatid Provincecode Provincename

1 01 Beijing

2 02 Shanghai City

3 03 Tianjin

4 04 Chongqing Municipality

5 05 Guangdong Province

6 06 Zhejiang Province

7 07 Fujian Province

8 08 Hainan Province

9 09 Jiangsu Province

Table 1

2 The fields of table tb_city are City ID number (Cityid), City Code (citycode), City name (CityName), and table 2 shows the example:

Cityid Citycode CityName

1 01001 Beijing

2 02001 Shanghai City

3 03001 Tianjin

4 04001 Chongqing Municipality

5 05001 Guangzhou City

6 05002 Shenzhen City

7 05003 Zhuhai City

8 05004 Maoming

9 05005 Zhongshan City

10 06001 Hangzhou City

11 06002 Wenzhou City

12 07001 Fuzhou City

13 07002 Xiamen

14 08001 Haikou City

15 80,023 Asian Cities

16 80.03 million Ning Shi

17 80,045 Point Mountain City

18 09001 Nanjing City

19 09002 Suzhou City

Table 2

Note: The point to be noted here is that the identity code is to the first two bits of the Yingcheng code.

Second, write code. The following is a complete source code:

(To be continued)



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.