Provincial name and city name pull selection box linkage
Source: Internet
Author: User
In the Drop-down form, the first list box has a,b,c three options, and when the user selects a, the second list box displays a1,a2,a3 three options (if the user selects B in the first list box, the second list box displays B1,B2,B3, and so on), when the user selects A1 in the Second list box, The third list box displays A11,a12,a13. How do I achieve this?
---------------------------------------------------------------
Give you one, and so on.
<script language= "JavaScript" >
<!--
var Onecount;
onecount=0;
subcat = new Array ();
Subcat[0] = new Array ("Xuhui District", "01", "001");
SUBCAT[1] = new Array ("Jiading", "01", "002");
SUBCAT[2] = new Array ("Huangpu", "01", "003");
SUBCAT[3] = new Array ("Nanchang", "02", "004");
SUBCAT[4] = new Array ("Jiujiang", "02", "005");
SUBCAT[5] = new Array ("Shangrao", "02", "006");
onecount=6;
function Changelocation (LocationID)
{
document.myform.smalllocation.length = 0;
var Locationid=locationid;
var i;
Document.myform.smalllocation.options[0] = new Option (' = = = = = = ALL Regions = = = = '];
For (I=0;i < onecount; i++)
{
if (subcat[i][1] = = LocationID)
{
Document.myform.smalllocation.options[document.myform.smalllocation.length] = new Option (subcat[i][0], subcat[i][2 ]);
}
}
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.