Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8378163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:51:53+00:00 2026-06-09T15:51:53+00:00

I have a search page that allows the user to search on many different

  • 0

I have a search page that allows the user to search on many different fields. After clicking search the page displays 10 entries per page by default, with the option to view the next 10, or pick a page number, using will_paginate. There is a drop down menu that allows you to pick how many entries the user sees per page.

I have tried two pieces of code:

Results per page: <%= select_tag :per_page, options_for_select([10,20,50], :selected=>params[:per_page]),  { :onchange => "this.form.submit();"}   %></br>

and

Results per page: <%= select_tag :per_page, options_for_select([10,20,50], :selected=>params[:per_page]),  :onchange => "'#{request.query_string}&per_page=' + this.getValue()"  %></br>

When the first drop down is changed to 20 for example, the page instantly searches again, but displays the results 20 per page.

The second drop down allows you to select a entry per page number, but to change the view, you have to re click search.

I want my code to work more like the first drop down, but I think re searching is a bit expensive. Is there a way to stop resubmitting the search but change the display?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:51:55+00:00Added an answer on June 9, 2026 at 3:51 pm

    If you change the amount of items displayed per page, a requery has to be done anyway (because only the items to display have been loaded from the database). And if you change the items displayed per page, and you are on page 2, what will you see? Items 10 – 60? So if you change the items per page, you almost always also switch to page one, and that requires a requery anyway.

    And second: it seems you want to reload the data in the javascript. You do a call to get the data, but seem to do nothing with the loaded data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an advanced search page that searches a number of fields in
I have an ASP.NET page that contains two div's. Both have search fields and
I have a page that displays search results and has a DOM like the
I have an ajax search box on my site that allows the user to
I have a page in my site that has allows users to search for
So I have created a custom search page that allows for me to search
I have a web application that allows a user to search on some criteria,
I have a search view that allows user's to search for their notecards, and
I have a search page that if there is results in the list it
I have a search page on my MVC site that contains a list of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.