Recently, I needed a search form that searched and resulted in posts from a specific category. I solved it by adding a hidden input field to my searchform.php file as follows:
Note, in the code above, I am searching posts in the category whose id is 21.
Pretty nifty, eh?
Thanks to WP Explorer for the idea.