如果是在form的提交事件里触发的事件,事件里应该写成return panduankong()

解决方案 »

  1.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function panduankong(propertyqueryform1){ 
                var op      =  propertyqueryform1.op.value; 
                var buyer  =  propertyqueryform1.buyer.value; 
                var address =  propertyqueryform1.address.value; 
                //alert (op+buyer+address); 
                if(op=="" && buyer=="" && address==""){  
                    alert("请输入查询信息!"); 
                    return false; 
                }
                return true; 
              
            } </script>
    </head><body>
    <form name="propertyqueryform1" onsubmit="return panduankong(this);">
    item1:<input type="text" name="op" size="10" />
    item2<input type="text" name="buyer" size="10" />
    item3<input type="text" name="address" size="20" />
    <input type="submit" name="btn2" value="post" />
    </form>
    </body>
    </html>
      

  2.   

    发现问题了   我在form里也同时调用了令一个js    谢谢大家了