In your success callback, you redirect the page to dispatient.php. I believe that this is the same page on which there is a search function. After redirecting, the page reloads again, and there is no point in writing:
$("#searchTerm").focus();
Since you are already using AJAX, try loading the grade data onto your page using JavaScript / jQuery without reloading the page.
source share