you need to put the form that you want to disappear in the div that will show the results.
At the moment, you have this for example:
form start
form end
div start
display results if searched else nothing
div end
so the div is changing as you have told the browser too, but the form is still on the outside so it wont disappear.
you want this:
div start
form start
form end
display results if searched
div end
that way when it has a search, it will disappear as the div content changes to your requested info
gotboots
Junior Poster in Training
60 posts since Jun 2011
Reputation Points: 12
Solved Threads: 4
Skill Endorsements: 0
How to hide search result when clicked anywhere or pressed escape key?
You could place the search result in a js popup dialog (jqueryui). I think ESC would close the popup.
diafol
Keep Smiling
10,672 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57