I have a page which normally displays 10 items per page and shows the page numbers at the bottom of the page as below:
<prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 next>
where each of the above is a page number and each page displays 10 items in turn.
There is a search option on this page which can be used to search the items by 'keywords' or 'categories'. When the search is done say, with a keyword 'sports', it displays the correct number of items but the page numbers at the bottom of the page displays the whole menu rather than showing,
<prev 1 2 next>
if there are under 20 items corresponding to that item search.
I am new to javascript and would like to know how the correct page number menu can be displayed based on the number of items pulled for each 'category' or 'keyword'.
Bookmarks