Google Search Style Search Field (Problem)

Recommended Posts

So I made a "Google Search" style Search Field based on the informations I found on a FMP blog, it's all nice and dandy except for one thing. I would like that when the user enter the text in the search field instead (or in the same way) of having to go and click on the search button (which performs the search script) he could press "enter" and it would perform the search anyways, is that possible?

Also, it would be cool that when the user selects the search field the text inside gets erased (at the moment I made it so it gets all selected). I tried to attach a script to the search field to achieve these two things but if I do that you can't enter text into the field anymore.