主题:  我昨天调了一夜了,程序挺简单,就是找不到错。大家帮忙看看阿

天儿呀

职务:普通成员
等级:1
金币:0.0
发贴:97
#12005/12/22 12:49:28
就是这段程序了,愁死我了!
<script language="javascript" type="text/javascript">
var hw_selecttext ="<%=msg%>"
//如果文本与值不同,请输入在文本后加上@值,如:北京@010|东城@001^西城@002
var TheSplit1 = "*"        //北京与上海的分隔符
var TheSplit2 = "|"        //北京与东城的分隔符
var TheSplit3 = "^"        //东城与西城的分隔符
var TheSplit4 = "@"        //文本与值的分隔符,可以省略
var hwallselecttext = hw_selecttext
var hwdefault_value = "山东济宁"

//默认值,在值有相同时有bug。

document.write('<select name="hw_1" onChange = "hw_select()" dataType="Require" msg="请选择大分类"></select> <select name="hw_2" onChange = "hw_select()" dataType="Require" msg="请选择小分类"></select>\n');
var hwallselecttextarr
hwallselecttextarr = hwallselecttext.split(TheSplit1);
hwArraylength = hwallselecttextarr.length;
var hwwhere = new Array(hwArraylength);
hwwhere[0]= new hw_comefrom("请选择@","请选择@";

for (var hwl=0;hwl<hwArraylength;hwl++)
{
    eval(hwwhere[hwl+1] = new hw_comefrom(hwallselecttextarr[hwl].split(TheSplit2)[0],hwallselecttextarr[hwl].split(TheSplit2)[1]))
}
function hw_comefrom(hwSelect_s1,hwSelect_s2) { this.hwSelect_s1 = hwSelect_s1; this.hwSelect_s2 = hwSelect_s2; }

function hw_select()
{
    with(document.all.hw_1)
    {
        var hwSelect_s12 = options[selectedIndex].value;
    }
    for(hwi = 0;hwi hwwhere.length;hwi ++)
    {
        if (hwwhere[hwi].hwSelect_s1.indexOf(TheSplit4)!=-1)
        {
            var hwThisV = hwwhere[hwi].hwSelect_s1.split(TheSplit4)[1];
        }
        else
        {
            var hwThisV = hwwhere[hwi].hwSelect_s1;
        }
        if (hwThisV == hwSelect_s12)
        {
            hwSelect_s13 = (hwwhere[hwi].hwSelect_s2).split(TheSplit3);
            for(hwj = 0;hwj hwSelect_s13.length;hwj++)
            {
                with(document.all.hw_2)
                {
                    length = hwSelect_s13.length;
                    if (hwSelect_s13[hwj].indexOf(TheSplit4)!=-1)
                    {
                        options[hwj].text = hwSelect_s13[hwj].split(TheSplit4)[0];
                        options[hwj].value = hwSelect_s13[hwj].split(TheSplit4)[1];
                    }
                    else
                    {
                        options[hwj].text = hwSelect_s13[hwj];
                        options[hwj].value = hwSelect_s13[hwj];
                    }
                    var hwSelect_s14=options[selectedIndex].value;
                }
            }
        break;
        }
    }
    //document.all.hw.value=hwSelect_s12+""+hwSelect_s14;
}
function hw_init()
{
    with(document.all.hw_1)
    {
        length = hwwhere.length;
        var hwm = 0
        for(hwk=0;hwk<hwwhere.length;hwk++)
        {
            if (hwwhere[hwk].hwSelect_s1.indexOf(TheSplit4)!=-1)
            {
                options[hwk].text = hwwhere[hwk].hwSelect_s1.split(TheSplit4)[0];
                options[hwk].value = hwwhere[hwk].hwSelect_s1.split(TheSplit4)[1];
                if (hwdefault_value.indexOf(hwwhere[hwk].hwSelect_s1.split(TheSplit4)[1])!=-1){hwm = hwk}
            }
            else
            {
                options[hwk].text = hwwhere[hwk].hwSelect_s1;
                options[hwk].value = hwwhere[hwk].hwSelect_s1;
                if (hwdefault_value.indexOf(hwwhere[hwk].hwSelect_s1)!=-1){hwm = hwk}
            }
        }
        selectedIndex = hwm
    }
    with(document.all.hw_2)
    {
        var hwn = 0
        hwSelect_s13 = (hwwhere[hwm].hwSelect_s2).split(TheSplit3);
        length = hwSelect_s13.length;
        for(hwl=0;hwllength;hwl++)
        {
            if (hwSelect_s13[hwl].indexOf(TheSplit4)!=-1)
            {
                options[hwl].text = hwSelect_s13[hwl].split(TheSplit4)[0];
                options[hwl].value = hwSelect_s13[hwl].split(TheSplit4)[1];
                if (hwdefault_value.indexOf(hwSelect_s13[hwl].split(TheSplit4)[1])!=-1){hwn = hwl}
            }
            else
            {
                options[hwl].text = hwSelect_s13[hwl];
                options[hwl].value = hwSelect_s13[hwl];
                if (hwdefault_value.indexOf(hwSelect_s13[hwl])!=-1){hwn = hwl}
            }
        }
        selectedIndex = hwn
    }
}
hw_init();
</script>



天儿呀

职务:普通成员
等级:1
金币:0.0
发贴:97
#22005/12/22 13:31:25
大家帮帮忙阿。可能就是一些语法的错误。但是我找不到阿



天儿呀

职务:普通成员
等级:1
金币:0.0
发贴:97
#32005/12/24 18:43:51
已经在别的论坛把问题解决了,5d怎么了?以前热心的人很多啊,版主也很负责的,现在人气也没了,版主也不负责了。看来我要走了!



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#42005/12/26 12:38:05
就没有看明白你问的什么问题.