0
Change Maxrows for Query
New Here
,
/t5/coldfusion-discussions/change-maxrows-for-query/td-p/700854
Feb 04, 2007
Feb 04, 2007
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/change-maxrows-for-query/m-p/700855#M65695
Feb 04, 2007
Feb 04, 2007
Copy link to clipboard
Copied
You have to use if/else logic in each option tag. Or you can
use cfselect which has a value attribute.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
/t5/coldfusion-discussions/change-maxrows-for-query/m-p/700856#M65696
Feb 05, 2007
Feb 05, 2007
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
sPetchy
AUTHOR
New Here
,
LATEST
/t5/coldfusion-discussions/change-maxrows-for-query/m-p/700857#M65697
Feb 05, 2007
Feb 05, 2007
Copy link to clipboard
Copied
Issue sorted - thanks very much
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

