我要取得下拉列表框的默认值以便判断,关键是:下拉列表的默认值是从数据库中取得的值可能为null字符串,我要判断它,大家说怎么写啊
function check_form($obj){
return true;}

解决方案 »

  1.   

    function check()
          {
    if( shortContent.serviceType.options[shortContent.serviceType.selectedIndex].value=='null')
    {
      alert("所输入的值不能为null!");

    return false;
    }
    对不对



          
      
      }
      

  2.   

    function check()
          {
    if( shortContent.serviceType.options[shortContent.serviceType.selectedIndex].value=='null')
    {
      alert("所输入的值不能为null!");

    return false;
    }
      }
    <INPUT type=submit value=提交 onClick="return check()">