请大家来解答
界面上有二个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();
}