PDA

View Full Version : Paging


Margaret101
07-07-2006, 10:29 AM
Hi!

I'm trying to do some paging on a search page. I have the next button working which I have called showNext but i cant get the show Previous to work. Can anyone see what i am doing wrong. The page should display 3 records at a time.


function showNext()
{

var i;

for (i=1; i<=intPosition; i++)
{
eval('ItemRow'+i+'.style.display="none"');
}
for (i=intPosition+1; i<=intPosition+3; i++)
{
eval('ItemRow'+i+'.style.display="block"');
}
intPosition=i-1


}
function showPrev(){
alert('Hello');
var i
alert('Hello Again');

for (i=intPosition; i<=intPosition; i--)
{
eval('ItemRow'+i+'.style.display="block"');
}
intPosition-=3
}

degsy
07-07-2006, 01:36 PM
Are you using client side javascript to show/hide the records?

That is an inefficient way of paging. You should do it server side.
http://www.brettb.com/EasyADORecordSetPaging.asp

Margaret101
07-07-2006, 03:00 PM
Hey ya Degsy!

I know your right but for this particular page i was asked to design it this way:confused: . The show next is fine but the previous button displays all past records at once. Can you see anyway of making them appear three at a time using this method..

degsy
07-12-2006, 03:14 PM
Is it client side javascript?
If so you'd be best off posting in a javascript forum.