var AFieldname1 = new Array("Subject","SKeyword","SEncrypt","FYear","SFrom","SToDo","SUpper","SCopyRep","SCopySend")
var AFieldTitle1 = new Array("发文标题","主题词","秘密等级","拟稿时间","拟稿人","拟稿部门","主送","抄送","局内分送")function add()
{
windows.status="Updating query...";
form=document.forms[0];
index=form.filednamelist.selectedindex;
FieldNameSel = AFieldname1[index];
connector=getRadioValue(form.andor);
if(connector=="1")
connector="and"
else
connector="or"
selectvalue=form.selectvalue

if(selectvalue=="")
alert("请输入查询值!")
else
{
cond1="(FIELD" + FieldNameSel + "CONTAINS\"" + selectvalue"\")";
allstring = form.allstring.value;
if(allstring=="")
allstring=cond1
else
allstring=cond1+allstring
form.allstring.value=allstring;
}
}

解决方案 »

  1.   

    cond1="(FIELD" + FieldNameSel + "CONTAINS\"" + selectvalue"\")";
    此句写法是否有误?
      

  2.   

    windows.status="Updating query...";
    改为:
    window.status="Updating query...";
      

  3.   

    这里有问题
    selectvalue=form.selectvalue

    if(form.selectvalue=="")
    alert("请输入查询值!")
    selectvalue是空的情况下,不执行alert
    为什么 ?
      

  4.   

    if(form.selectvalue==null || form.selectvalue=="")
      

  5.   

    还是不行
    <input name=selectvalue class=text>
    始终不能判断这个文本框为空
      

  6.   

    <input name=selectvalue id=selectvalue class=text>再试试
      

  7.   

    应该是这样吧。
    if(form.selectvalue.value==null || form.selectvalue.value=="")
      

  8.   

    if(form.selectvalue.value=="")
      alert("请输入查询值!")