php - Searching not working in ajax once textbox onblur event is called -


I have the following code to search through AJAX Now if I type onblur Apply the event (so that the search result disappears) and then come back to the text box, the search feature is no longer working. So the thing is that it can not be able to call onfocus event correctly once the code is called onblur any help would be appreciated.

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ (". Searchproductbrand") keyup (function () {var kw = $ (". Searchproductbrand"). Val (); if (kw! = '') {$ Jax ({type: "POST", url: "livesearch.php", data: "kw =" + kw, success: function (option) {$ ("# livesearch"). Html (option); document.getElementById ( "Life-education"). Style.bird = "1px solid # a5 acb2";}})} and {$ ("#scache"). Html (""); document.gate elementbid ("lifeship") Style.border = "0 pixels";} return false;});}); & Lt; / Script & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ (". Searchproductbrand"). Blur (function () {document.getElementById ("livesearch"). Style.display = "none";})}); & Lt; / Script & gt;  

Livesearch is a div where I print my search results.

Perhaps your lifestyle is still hidden, try it:

  & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ (". Searchproductbrand") keyup (function () {var kw = $ (". Searchproductbrand"). Val (); if (kw! = '') {$ Jax ({type: "POST", url: "livesearch.php", data: "kw =" + kw, success: function (option) {$ ("# livesearch"). Show (); // "#Livesearch") .HTML (option); document.getElementById ("livesearch"). Style.border = "1px solid # A5ACB2";}})}} and {$ ("# livesearch"). Html (" ); Document.getElementById ("livesearch"). Style.border = "0px";} return false;});}); & Lt; / Script & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ (". Searchproductbrand"). Blur (function () {document.getElementById ("livesearch"). Style.display = "none";})}); & Lt; / Script & gt;  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -