当前位置: 代码迷 >> ASP.NET >> 请大家来解答,该怎么解决
  详细解决方案

请大家来解答,该怎么解决

热度:9403   发布时间:2013-02-25 00:00:00.0
请大家来解答
界面上有二个dropdownlist控件,dropdownlist1和dropdownlist2和一个文本框控件
text1,想用javascrip来判断如果两个   dopdownlist控件的selectedItem.value= "-1 "和text1.value的值为空时弹出提示框来提示请把内容填写完整.
应该怎样实现恳请高手帮忙

------解决方案--------------------------------------------------------
if(document.getElementById( "dropdownlist1 ").value == "-1 "||document.getElementById( "dropdownlist2 ").value == "-1 "||document.getElementById( "Text1 ").value == " "){ alert( "请输入完整! ");return false;}
------解决方案--------------------------------------------------------
if(document.getElementById( "class ").value== "-1 ")
{
alert( "Please select class! ");
document.getElementById( "class ").focus();
}

if (document.getElementById( "shijian ").value== "-1 ")
{
alert( "Please select time! ");
document.getElementById( "shijian ").focus();
}

if (document.getElementById( "xingming ").value== " ")
{
alert( "Please input name! ");
document.getElementById( "xingming ").focus();
}
  相关解决方案