日期:2014-05-16  浏览次数:20336 次

jquery autoComplete五:autothink.jsp续五
    //点击查找按钮
    function onFindButton(){
var productName = $("#inputProductSearch").val();
if(productName=="<bean:message key='support.navigate.auto.think.inputInfo'/>"){
productName="";
}
     if("" != productName && 0 != productName.length){
$("#searchProduct").attr('action',root_url + "pages/navigation/gotoKBNavi.do?actionFlag=autoThinkNewPage&colID=<%=kc_colID%>");
$("#searchProduct").submit();
}else{
alert("<bean:message key='support.navigate.auto.think.inputInfo'/>");
     return false;
     }
    }
     $(function(){ $("#findProduct").click(onFindButton)});
     //处理特殊按键 如回车.
     function pressOnkey(event){
     if(event.keyCode==13||event.which==13){
     onFindButton();
     }
     }
</script>
</HEAD>
<BODY>
<FORM name="searchProduct" id="searchProduct" method="POST">
  <input name="inputProductSearch" id="inputProductSearch" type="text" class="docment_search_input"  maxlength="30"
  value="<%= "null"==request.getAttribute("productName") || null==request.getAttribute("productName") ? searchinfo : ((String)request.getAttribute("productName")).replaceAll("\"","&quot;")%>"
  onfocus="defineDocSearchInput()"  onkeypress="pressOnkey(event)">
<input name="findProduct" id="findProduct" type="button" class="docment_search_find">
</FORM>
</BODY>
</html:html>