473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Paging using java script and i really need help

Hi!!

I'm trying to do some simple paging with goes to the database once and then shows and hides the results to display 3 items at a time. It uses a next and previous button. The next button works but the previous button displays all previous results and not just the last three results.

What i need it to do is hide all results and show the last three
This is my code and i really do need a little help pleaaaaaase!!

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT>
  2. var intPosition=0;
  3. function ShowFirstThreeItems()
  4. {
  5.     var i;
  6.     i=1;
  7.     for (i=1; i<=3; i++) 
  8.     {
  9.     eval('ItemRow'+i+'.style.display="block"');
  10.     intPosition=i;
  11.  
  12.     }
  13. }
  14. function showNext()
  15. {
  16.  
  17.     var i;
  18.  
  19.     for (i=1; i<=intPosition; i++) 
  20.     {
  21.     eval('ItemRow'+i+'.style.display="none"');
  22.     }
  23.     for (i=intPosition+1; i<=intPosition+3; i++) 
  24.     {
  25.     eval('ItemRow'+i+'.style.display="block"');
  26.     }
  27.     intPosition=i-1
  28.  
  29.  
  30. }
  31.  
  32.  
  33. function showPrev()
  34. {
  35.  
  36.     var i;
  37.  
  38.  
  39.     for (i=intPosition; i>0; i--)
  40.     {
  41.     eval('ItemRow'+i+'.style.display="block"');
  42.     }
  43.     for (i=intPosition+1; i<=intPosition-1; i--) 
  44.     {
  45.     eval('ItemRow'+i+'.style.display="none"');
  46.     }
  47.     intPosition=i-3
  48.  
  49.  
  50. }
Aug 8 '06 #1
1 5879
Hello, I think U got your answer. But will u please help me out..
I also need the paging in java script..& my back end is PGSQL.
Will u please send me the code of that?...
Jul 20 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
0
by: Chan | last post by:
I have about 1,000 records in my XML to be shown. It's too much to display all of them at once. So, paging is a good implementation. I'm doing all this at client side, that is, - xml dataisland...
0
by: Stephen | last post by:
This is a real brain-teaser and i'd really appreciate it if someone can try and understand what im trying to do and give me a few pointers or ideas to help me work out my problem. Im basically...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
0
by: dnphamus13 | last post by:
I'm new to this and drowning right now. I would like to put my database online for viewing. I managed to do the filtering but i need to do PAGING as the XML doc get bigger. From what i understand...
2
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is...
3
osward
by: osward | last post by:
Hi, everyone, I had managed to make use of the date link from a simple calendar script to my query table. When I click on the date's link or Prev and Next Month link, The table first row will be...
2
by: poornimanithya76 | last post by:
Hi, I am having grid view an my page which is having template fields(text box, check box and drop down).If user clicks on check box i need to consider text box and drop down as a required fields.i...
2
by: jaredciagar | last post by:
Hi Guys, Please Help ME.... I have a problem in displaying data in my gridview with paging, the data from the database is displaying to my gridview but I want to allow paging in my gridview.how can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.