CF Set form.variable for query and Next/Previous pages error


i have cf form select posts cf "action" page.

 

on action page i: cfset itemnumber=#form.itemnumber#

 

i cfoutput 'itemnumber' cfquery (which inner join dependant on '#itemnumber#')...

 

all of above works fine , displays database fields in color alternating rows, per rest of code.

 

here's problem:

 

i'm displaying 40 rows on page per "next , previous" code. (cfparam name="start" default="1" , cfparam name="disp" default="40" along rest of nextn code in header , body). display 40 rows on page , puts link @ bottom of page "next 40 rows", etc.

 

note: i'm querying database once , using query (query name="data") populate table rows , nextn code (cfoutput name="data") , (cfif start + disp greater data.recordcount, etc)...

 

the problem happens when click "next 40 rows" link display 2nd page of rows. since (i'm assuming) nextn code 're-reading' same page top bottom, error thrown when code tries read cfset itemnumber=#form.itemnumber# @ top of page.

with #form.itemnumber# on action page coming previous posting of form action page, when "next 40 rows" link clicked , nextn code re-reads action page - cfset itemnumber (#form.itemnumber) not getting populated , throws error...

 

i hope i've not made sound confusing.

 

i can nextn code work when i'm querying database without "flying in" form variable. when cfset variable (#form.itemnumber#) inserted query, second page of nextn throws error , doesn't display.

 

i include page code here lengthy and, well, nextn code 'standard' cf code -- i've narrowed problem down above "element undefined" (when page tries reload "next 40 rows" link) , hoping there's simple fix or way display records in next , previous pages.

 

thanks in advance shedding light on this.

- e

i assume "next/last" links hyperlinks, not form buttons? , they're linking to, say, "mypage.cfm?from=10&count=40...etc.." ?

 

as click hyperlink remember clear form scope, variable won't there in new page - you'll need pass through url scope.

 

i think that's mean, unless i'm misunderstood. likely.

 

o.



More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO