Retain dropdown select search selection onChange
When you select either of the dropdowns, does it clear both of the other fields? I can't currently see anything wrong with the text field, so if that isn't retaining its value on submit then there might be something at play earlier in the code.
For the dropdowns, you should be able to use the selectedIf() function that's already present in the first one. The format for this is "selectedIf( optionValue, selectedValue )". The existing one is close; you should just need to change "document_category" to "document_category_match" so that it's the same as the select's name, like this:
<option value="<?php echo $value; ?>" <?php selectedIf($value, @$_REQUEST['document_category_match']) ?>><?php echo $label; ?></option>
The same can be added to the second dropdown's options, with "date_year" used instead of "document_category_match".
Let me know if this helps with any of your issues, or if you have any questions!