<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> drop-down frame form linkage </title>
<script type= "Text/javascript" src= "Jquery-1.8.3.js" ></script>
<script type= "Text/javascript" >
$ (function () {
function Objinit (obj) {
return $ (obj). html ("<option> please select </option>");
};
var arrdata={
Manufacturer 1:{Brand 1_1: "Model 1_1_1, Model 1_1_2",
Brand 1_2: "Model 1_2_1, Model 1_2_2",},
Manufacturer 2:{Brand 2_1: "Model 2_1_1, Model 2_1_2",
Brand 2_2: "Model 2_2_1, Model 2_2_2",},
Manufacturer 3:{Brand 3_1: "Model 3_1_1, Model 3_1_2",
Brand 3_2: "Model 3_2_1, Model 3_2_2",},
};
$.each (Arrdata,function (PF) {
$ ("#selF"). Append ("<option>" +pf+ "</option>");
});
$ ("#selF"). Change (function () {
Objinit ("#selT");
Objinit ("#selC");
$.each (Arrdata,function (pf,ps) {
if ($ ("#selF option:selected"). Text () = = PF) {
$.each (PS, function (pt,pc) {
$ ("#selT"). Append ("<option>" +pt+ "</option>");
});
$ ("#selT"). Change (function () {
Objinit ("#selC");
$.each (Ps,function (pt,pc) {
if ($ ("#selT option:selected"). Text () ==pt) {
$.each (Pc.split (","), function () {
$ ("#selC"). Append ("<option>" +this+ "</option>");
});
}
})
});
}
});
});
$ ("#button1"). Click (function () {
var strvalue= "Your choice of vendor:";
strvalue+=$ ("#selF option:selected"). Text ();
strvalue+= " Your choice of brand:";
strvalue+=$ ("#selT option:selected"). Text ();
strvalue+= " the model you selected:";
strvalue+=$ ("#selC option:selected"). Text ();
$ ("#divTip"). Show (). HTML (strvalue);
});
});
</script>
<body>
<div class= "Clsinit" >
Manufacturer: <select id= "Self" ><option> please select </option></select>
Brand: <select id= "SelT" ><option> Please select </option></select>
Model: <select id= "SELC" ><option> Please select </option></select>
<input id= "button1" type= "button" value= "Query" class= "BTN"/>
</div>
<div class= "Clsinit" id= "Divtip" style= "Display:none;" ></div>
</body>