Hi,
The challenge with what you are asking is that you must rely on what the user enters into the text field and that data must match exactly what the search term is from the database record ... does that make sense?
So if someone enters Fruit, friut, fruits in the text field, none of them will match up correctly with fruit which is the matching field to populate your subcategory list.
You can try to manage some of this concern using javascript validation and post-processing ...
var cat = document.getElementById('cat').value;
if ( /fruit/i.test( cat ) ) {
cat = 'fruit';
}
This will remedy cases likeFruit and fruits but not transposed letters or miss spellings like friut or frute ... which are both actually quite common problems.
From here you will need to populate the form variable to be submitted with the identified 'cat' value and then activate or submit the form with javascript -- which means all of this must be processed before the form is submitted with the existing script on your page.
I'm not really willing to sit here and rewrite this entire page to allow text field entry of options, but if you decide to take this on, I will be glad to give you pointers along the way.
Good luck