错误的提示是什么?
查看你生成的JS数据,value是什么,是否真的是"网络",加trim试试,我这试过都是好的
查看你生成的JS数据,value是什么,是否真的是"网络",加trim试试,我这试过都是好的
解决方案 »
- 怎样document.form1.submit()与onsubmit事件同时起作用?
- JS表单验证
- 大幅卷屏广告JS代码 广告图片帮忙图片价格超连接
- js如何快速查找3千行数据中没有重复的数据存入并且提示重复的行数
- 点击导航,显示一个选项卡
- 关于日期的问题,拜托大家帮忙了,急,分不够可加
- 推荐本javascript书
- 急求代码:如果已经设为首页了就不在询问是否设为首页,该怎么写啊
- 如何打开一个新的ie窗口
- 正则表达式替换的问题
- 关于拖曳,能不能将子窗口的元素拖曳到父窗口呢?
- 请问大家,页面上有两组不同名的radio按钮,怎样实现,当按第一组的radio某个选项的时候使第二组radio变成灰色.
<html>
<head>
<title></title>
</head>
<SCRIPT language="javascript" >
var optionNum = "";
var hospitalList = new Array("","水果","肉类");
var roomList = new Array( );
roomList[0] = new Array("请选择类别");
roomList[1] = new Array("苹果","梨","香蕉");
roomList[2] = new Array("猪肉","牛肉","鸡肉==你敢吃么??");
function initSelect1()
{
while ( document.all.hospital.options.length > 0)
hospital.options.remove(0);
for (var i = 0; i < hospitalList.length; i++)
{
var opt = document.createElement("OPTION");
opt.value = hospitalList[i];
opt.text = hospitalList[i];
document.all.hospital.options.add(opt);
opt = null;
}
initSelect2();
document.all.hospital.onchange = initSelect2;
}function initSelect2()
{
while (document.all.room.options.length > 0)
document.all.room.options.remove(0);
var myArr = roomList[document.all.hospital.selectedIndex];
for (var i = 0; i < myArr.length; i++)
{
var opt = document.createElement("OPTION");
opt.text = myArr[i];
opt.value = myArr[i];
document.all.room.options.add(opt);
opt = null;
}
var optionNum = document.all.hospital.selectedIndex;
}
function window.onload()
{
initSelect1(document.all.hospital);
}
function IndexDemo(str2){
var str1 = "BABEBIBOB.UBABEBIBOBU"
var s = str1.indexOf(str2);
alert(s);
}</SCRIPT>
<body>
<p>
<select name= "hospital" id = "hospital" style="width:100px">
</select>
<Select id = "room" style="width:200">
</Select>
连动select菜单:
</p>
<p> </p>
<form name="form1" method="post" action="">
<p> </p>
<p>
<input type="submit" name="Submit" value="连动select菜单" onClick="IndexDemo(this)">
</p>
</form>
<p> </p>
</body>
</html>