1. Ссылки не нужны, используйте спаны в пагинации
<form method="get" id="testForm">
<input type="text" name="name" class="page" />
<input type="submit" name="search" id="search" value="Поиск"/>
<input type="hidden" name="current_page" id="current_page" value="{current_page}">
</form>
<span id="pagination">
<span class="toPage" data-num="1">1</span>
<span class="toPage" data-num="2">2</span>
<span class="toPage" data-num="3">3</span>
<span class="toPage" data-num="4">4</span>
<span class="toPage" data-num="5">5</span>
<span class="toPage" data-num="6">6</span>
<span class="toPage" data-num="7">7</span>
</span>
2. Такой JS:
$(document).on("click", ".toPage", function () {
var num = $(this).data("num");
$(".page").prop("value", num);
$("#testForm").trigger("submit");
});