全民慕诗琪不直播了吗:请教一个关于网站制作的问题!

来源:百度文库 编辑:高考问答 时间:2024/04/30 04:25:57
我做了一个注册的网页,里面用了二级下拉菜单,使用的是javascript,现在我在下拉菜单中选定内容后,却无法将菜单里的内容存入数据库,我看了源代码后,是因为下拉菜单的value值无法确定,不知有没有高手能指点一下如何将下拉菜单中选取得的值存入数据库!
下面是我的代码段!
<select name="university" id="university" onChange = "hw_select()">
<OPTION selected value="">请选择院校</OPTION>
</select>
下面的是js声明的函数hw_select
function hw_select()
{
with(document.baoming.university)
{
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.baoming.major1)
{
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;
}
}

for(hwj = 0;hwj < hwSelect_s13.length;hwj++)
{
with(document.baoming.major2)
{
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;
}

你去www.fh888.com看看吧~
好像是这样一来打得~应该没错~