Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change Maxrows for Query

New Here ,
Feb 04, 2007 Feb 04, 2007
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
313
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 04, 2007 Feb 04, 2007
You have to use if/else logic in each option tag. Or you can use cfselect which has a value attribute.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 05, 2007 Feb 05, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2007 Feb 05, 2007
LATEST
Issue sorted - thanks very much
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources