jQuery UI Autocomplete extraParams Problem

jQuery UI Autocomplete extraParams Problem

I have a jQuery autocomplete application where the user types a query into a text box and autocomplete suggestions are returned.  (It's working fine.)  I would like to restrict the suggestions that are returned by passing the value of the selected option from a drop-down list (#deptField3) to the PHP script that does the autocomplete look-up.

Here is my code:

  1. <script type="text/javascript">
  2. <!--
  3. $(function() {
  4. $("#directorySearchField-desktop").autocomplete({
  5. source: "/directory/includes/scripts/autocomplete.php",
  6. extraParams: { 
  7.    dept: function() { return $("#deptField3").val(); } 
  8. },
  9. minLength: 2,
  10. delay: 0,
  11. select: function(event, ui) {
  12. $('#LN').val(ui.item.LN);
  13. $("#searchForm").submit();
  14. }
  15. });
  16. });
  17. -->
  18. </script>
When I look at the URL (get request) that is being passed off to the PHP autocomplete script, it is correctly appending my search term in the URL as follows:

MY-SITE/autocomplete.php?term=MySearchTerm

... but the additional parameter "dept" (which is set in line #8 in the code above) is not being appended to the autocomplete URL.

In other words, if it were working properly, the URL should look like this:

MY-SITE/autocomplete.php?term=MySearchTerm&dept=SelectedDeptValue


Thanks in advance for any insight/assistance that you may be able to offer.

- John