Js to achieve level five linkage

Source: Internet
Author: User

JS implementation of a number of multi-level linkage, here is the example of a 5-class linkage, in fact, can be expanded into N-level linkage, in the project when it encountered such a problem? But there is no way to load these options dynamically from the database, so only a way to handle them from a single page should be generated dynamically for the project's form. Therefore, each process needs to have a separate page to process the design process, which determines the existing business logic can not be changed to achieve multi-level form linkage.
Code is as follows:
<title> Cascade </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<style>
Body,select
{
font-size:9pt;
Font-family:verdana;
}
A
{
color:red;
Text-decoration:none;
}
A:hover
{
Text-decoration:underline;
}
</style>
<script language= "JavaScript" >
function Dsy ()
{
This. Items = {};
}
Dsy.prototype.add = function (Id,iarray)
{
This. Items[id] = IArray;
}
Dsy.prototype.Exists = function (ID)
{
if (typeof (this. Items[id]) = = "undefined")
return false;
return true;
}
function Change (v)
{
var str= "0";
for (i=0;i<v;i++)
{
str+= ("_" + (document.getElementById (S[i]). selectedIndex-1));
};
var Ss=document.getelementbyid (S[v]);
With (SS)
{
length = 0;
Options[0]=new Option (Opt0[v],opt0[v]);
if (v && document.getElementById (S[v-1]). selectedindex>0 | |!v)
{
if (dsy. Exists (str))
{
AR = Dsy. ITEMS[STR];
for (i=0;i<ar.length;i++) options[length]=new Option (Ar[i],ar[i]);
if (v) options[1].selected = true;
}
}
if (++v<s.length)
{
Change (v);
}
}
}
var dsy = new Dsy ();
Dsy.add ("0", ["Complaint declaration", "business consulting", "User appointment", "Service scheduling", "other"]);
Dsy.add ("0_0", ["Standardized Products", "industry products", "Service Products", "Customer Service"]);
Dsy.add ("0_0_0", ["Voice Class", "Access Class", "SMS Class", "other"]);
Dsy.add ("0_0_0_0", ["Cornet trunking Network", "group VPMN", "Mobile Switchboard", "Group Switchboard", "Group Ringtones", "V net Companion"]);
Dsy.add ("0_0_0_0_0", ["Deny Transact", "Dial the empty Number", "two times to confirm SMS problem", "SMS query Cornet information asked
"Boss system Failure", "other"]);
Dsy.add ("0_0_0_0_1", ["denial of processing", "other"]);
Dsy.add ("0_0_0_0_2", ["Dialing null", "Boss system failure", "Dialing Prompt" shutdown "]);
Dsy.add ("0_0_0_0_3", ["other"]);
Dsy.add ("0_0_0_0_4", ["denial of handling", "loss of entire group ring tones", "system failure", "Tariff error", "Cannot hear group color
Bell "," Boss system failure "," ring tone setting "," other "]);
Dsy.add ("0_0_0_0_5", ["denial of processing", "other"]);
Dsy.add ("0_0_0_1", ["GPRS Enterprise Access", "Mobile Mailbox (Pushmail)", "BlackBerry", "IP Line"]);
Dsy.add ("0_0_0_1_0", ["Fee Error Collection", "terminal cannot receive", "Boss system failure", "other"]);
Dsy.add ("0_0_0_1_1", ["Package", "terminal cannot receive", "Boss system failure", "other"]);
Dsy.add ("0_0_0_1_2", ["Package", "terminal cannot receive", "Boss system failure", "other"]);
Dsy.add ("0_0_0_1_3", ["Data Line", "Voice Line"]);
Dsy.add ("0_0_0_2", ["Enterprise Signaling", "SMS Direct connection (MAS)", "3M"]);
Dsy.add ("0_0_0_2_0", ["Unable to send SMS", "terminal cannot receive", "Boss system failure", "Charge error", "Unable to log
"Other"]);
Dsy.add ("0_0_0_2_1", ["Unable to send SMS", "terminal cannot receive", "Boss system failure", "Charge error", "Unable to log
"Other"]);
Dsy.add ("0_0_0_2_2", ["Unable to send SMS", "terminal cannot receive", "Charge error Received", "Cannot login", "other"]);
Dsy.add ("0_0_0_3", ["Mobile Dictionary", "Enterprise Mailbox", "other"]);
Dsy.add ("0_0_0_3_0", ["Cannot Login", "other"]);
Dsy.add ("0_0_1", ["School Communication", "financial communication", "Police Service", "Silver Communication", "Urban Management Tong", "government affairs", "material circulation", "other"]);
Dsy.add ("0_0_1_0", ["denial of processing", "Tariff Error Collection", "terminal delay (or inability) to receive", "other"]);
Dsy.add ("0_0_1_1", ["denial of processing", "Tariff Error Collection", "terminal delay (or inability) to receive", "other"]);
Dsy.add ("0_0_1_2", ["terminal delay (or inability) to receive", "other"]);
Dsy.add ("0_0_1_3", ["denial of processing", "Tariff Error Collection", "terminal delay (or inability) to receive", "other"]);
Dsy.add ("0_0_1_4", ["denial of processing", "Tariff Error Collection", "terminal delay (or inability) to receive", "other"]);
Dsy.add ("0_0_1_5", ["denial of processing", "Tariff Error Collection", "terminal delay (or inability) to receive", "other"]);
Dsy.add ("0_0_1_6", ["denial of processing", "Tariff Error Collection", "terminal delay (or inability) to receive", "other"]);
Dsy.add ("0_0_1_7", ["other"]);
Dsy.add ("0_0_2", ["Trans-City VPMN", "Cross-city cornet cluster Network", "group Payment"]);
Dsy.add ("0_0_2_0", ["interconnection", "Tariff Error Collection", "other"]);
Dsy.add ("0_0_2_1", ["interconnection", "Tariff Error Collection", "other"]);
Dsy.add ("0_0_2_2", ["interconnection", "Tariff Error Collection", "other"]);
Dsy.add ("0_0_3", ["Account Manager", "Booths", "distributor", "product developer"]);
Dsy.add ("0_0_3_0", ["Service Attitude", "business acceptance delay", "Business acceptance Error", "Contact no Answer"]);
Dsy.add ("0_0_3_1", ["Service Attitude", "business acceptance delay", "Business acceptance Error", "Contact no Answer"]);
Dsy.add ("0_0_3_2", ["Service Attitude", "business acceptance delay", "Business acceptance Error", "Contact no Answer"]);
Dsy.add ("0_0_3_3", ["Service Attitude", "business acceptance delay", "Business acceptance Error", "Contact no Answer"]);
Dsy.add ("0_1", ["Standardized Products", "industry products", "service Products"]);
Dsy.add ("0_1_0", ["Cornet trunking Network", "Mobile Switchboard", "Group Switchboard", "group Ringtone", "V net Companion", "GPRS Enterprise Access", "hand
e-mail (pushmail) "," Blackberry "," IP Leased Line "," Enterprise Credit "," SMS Direct link (MAS) "," Enterprise Mailbox "," Mobile word
Code "]);
Dsy.add ("0_1_0_0", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_1", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_2", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_3", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_4", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_5", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_6", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_7", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_8", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_9", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_10", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_11", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_0_12", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1", ["School Communication", "financial communication", "Police Service", "Silver Communication", "Urban Management Tong", "government affairs", "material circulation", "other"]);
Dsy.add ("0_1_1_0", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1_1", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1_2", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1_3", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1_4", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1_5", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1_6", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_1_7", ["other"]);
Dsy.add ("0_1_2", ["Trans-City VPMN", "Cross-city cornet cluster Network", "group Payment"]);
Dsy.add ("0_1_2_0", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_2_1", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_1_2_2", ["Business processing conditions and processes", "Product use function", "Tariff Billing Introduction", "System Operation Guidelines", "marketing
Programme "]);
Dsy.add ("0_2", ["Product Application", "other"]);
Dsy.add ("0_2_0", ["New Cornet Cluster Network", "new group Ringtone", "New Mobile Mailbox", "New Mobile Switchboard", "new group total
Machine "," New BlackBerry "," New IP Leased Line "," New SMS Direct Connection "," New Enterprise Link "," other "]);
Dsy.add ("0_2_1", ["other"]);
Dsy.add ("0_3", ["Onsite service", "Telephone service", "other"]);
Dsy.add ("0_3_0", ["Account Manager", "Enterprise ICT Developer", "Mobile Switchboard developer", "mobile business card Developer", "BlackBerry development
Business "," Mobile mail Developer "," School communication partner "," Financial communication partner "," material circulation partner "," other ");
Dsy.add ("0_3_1", ["Account Manager", "Enterprise ICT Developer", "Mobile Switchboard developer", "mobile business card Developer", "BlackBerry development
Business "," Mobile mail Developer "," School communication partner "," Financial communication partner "," material circulation partner "," other ");
</SCRIPT>
<script language = "JavaScript" >
var s=["S1", "S2", "S3", "S4", "S5"];
var opt0 = ["? Level selection", "Two-level selection", "three-level selection", "four-level selection", "Five-level selection"];
function Setup ()
{
for (i=0;i<s.length-1;i++)
document.getElementById (S[i]). Onchange=new Function ("Change (" + (i+1) + ")");
Change (0);
}
</SCRIPT>
<body bgcolor= "#E0E0E0" onload= "Setup ()" style= "margin:0" >
<form name= "frm" >
<select id= "S1" &GT;&LT;OPTION&GT;? level selection </option></select>
<select id= "S2" ><option> two level selection </option></select>
<select id= "S3" ><option> three level selection </option></select>
<select id= "S4" ><option> four level selection </option></select>
<select id= "S5" ><option> five level selection </option></select>
</form>
</body>

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.