var nSubtopics;
var nTopics;
var aTopicText;
var aTopicValue;
var aSubtopicText;
var aSubtopicValue;
var nSelectedTopic;
var nSelectedSubtopic;
Funktion OnInitial ()
{
//debugger; ;
var I, J, n, strTopic, strSubtopic;
nTopics =document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) .options.length;
aTopicText = neue Reihe (nTopics);
aTopicValue = neue Reihe (nTopics);
für (i=0; i< nTopics; i++)
{
aTopicText [i] = document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) .options [i] .text;
aTopicValue [i] = document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) .options [i] .value;
}
nSubtopics = document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .options.length;
aSubtopicText = neue Reihe (nSubtopics);
aSubtopicValue = neue Reihe (nSubtopics);
für (i = 0; I < nSubtopics; i++) {
aSubtopicText [i] = document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .options [i] .text;
aSubtopicValue [i] = document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .options [i] .value;
}
nSelectedTopic = document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) .selectedIndex;
nSelectedSubtopic = document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .selectedIndex;
wenn (nSelectedTopic == 0) {
document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .options.length = 1;
}
sonst {
strTopic = document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) .options [nSelectedTopic] .text;
n = strTopic.length;
J = 0;
für (i = 1; I < nSubtopics; i++) {
strSubtopic = aSubtopicValue [i];
wenn (strTopic! = strSubtopic.substring (0, N))
{
document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .options [i - J] = Null;
j++;
}
}
}
}
Funktion OnChangeTopic ()
{var I, J, n, strTopic, strSubtopic, strSubtopicVal;
wenn (nSelectedTopic! = document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) .selectedIndex)
{
nSelectedTopic = document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) .selectedIndex;
strTopic = document.getElementById („_ctl0_ContentPlaceHolder1_ddlTopic“) [nSelectedTopic] .text;
document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .options.length = 1;
wenn (nSelectedTopic! = 0)
{
J = 1;
n = strTopic.length;
für (i = 1; I < nSubtopics; i++)
{
//strSubtopic = aSubtopicValue [i];
strSubtopic = aSubtopicText [i];
strSubtopicVal = aSubtopicValue [i];
wenn (strTopic == strSubtopic.substring (0, N))
{
document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .options [J] = neue Wahl (strSubtopic.substring (n + 1, strSubtopic.length), strSubtopicVal);
wenn (nSelectedSubtopic == i) {
document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .selectedIndex = J;
}
j++;
}
}
}
}
}
Funktion OnChangeSubtopic ()
{var I, n, strSubtopic;
n = document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) .selectedIndex;
wenn (n == 0)
{
nSelectedSubtopic = 0;
}
sonst
{
strSubtopic = document.getElementById („_ctl0_ContentPlaceHolder1_ddlSubtopic“) [n] .value;
für (i = 1; I < nSubtopics; i++)
{
wenn (strSubtopic == aSubtopicValue [i])
{
nSelectedSubtopic = i;
Bruch;
}
}
}
}
|