不知道各位有沒有遇見這樣的問題,就是在summary.php上搜索的時候,如果搜索的字符過短(比如: we ),系統就會報錯。我在英文支持上找到了相同的問題,其間有人建議可以設定搜索的最短字符。原文:http://www.lifetype.net/forums/viewtopic.php?p=16481&sid=1ca58ac6b9519b711011b3af9735c464#16481
 但是我看不出來,因該把下面的字段加在哪裏。
function searchLength() { 
       
   var field = document.getElementById("formSearchField"); 
   if (field.value.length < 4) { 
      alert('Your error message here...'); 
      return false; 
   } else { 
      return true; 
   } 
}請問,有人試過麽?我想這是一個很好的主意,可以減少數據庫的查詢。