Skip to main content
Participant
February 4, 2007
Question

Change Maxrows for Query

  • February 4, 2007
  • 3 replies
  • 348 views
Hi,

I'm hoping this is straight forward! I've got a fairly simple paging query which I would like to improve slightly by allowing the user to alter how many results they view per page. Ideally I want to do this using a drop down menu. I've had a go and I can't quite get it to work. The code I've tried is below.

The first section check to see if an URL value has been parsed for the maxrows, defaulting to 10 rows on the first row. The second bit is my attempt at an option menu with the onchange function to parse the new max rows value to the url. However what seems to be happening is that the URL value simply takes that from the initial ifdefined section.

Any hints would be much appreciated. TIA. Simon
    This topic has been closed for replies.

    3 replies

    sPetchyAuthor
    Participant
    February 5, 2007
    Issue sorted - thanks very much
    Inspiring
    February 5, 2007
    This is not really a CF issue. Change your OnChange event to

    onchange="window.location=''search_results.cfm?... max_rows='+this.value+'..."

    You are setting the OnChange URL to the value CF is using for max_rows. By using this.value, you are going to be setting the "new" max_rows when the event triggers.

    CR
    Inspiring
    February 4, 2007
    You have to use if/else logic in each option tag. Or you can use cfselect which has a value attribute.