Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Navigation through records

    hi, I am generating records through php/sql, as u can see the code displays 5 records, what Im trying to do is program so that when the next button is pressed the next 5 records will show?? any help much appreciated thank you,

    the code -
    Code:
    function show(qstring,qtype){
     $("#vsdiv").show();
     var myurl="scripts/searchpage.php"; 
     $.ajax({
      url: myurl, dataType:'json',data:{querystring:qstring,querytype:qtype},
      success: function(member){
       $("#results").append('<tr class="me">'+
                                                '<th>#REC</th><th>name</th><th>surname</th>');
       var j=0;var totrecs=1;
       for(var i=0;i<5;i++){
        $("#results").append('<tr class="rows'+j+'">'+
    	        		  '<td class="ids" id="z'+i+'">'+totrecs+'</td>'+
    			  '<td>'+name[i].bdate+'</td>'+
    			  '<td class="users" id="username'+i+'">'+member[i].username+'</td>'+
    			  '<td id="contact'+i+'">'+member[i].fname+' '+member[i].lname+'</td>'+
    			  '<td><input type="checkbox" name="whome" id="showMe'+i+'"'+
                                                 'class="boxes" onclick="getMe('+i+')" /></td></tr>');	
          totrecs++;
          j++;
         }
        }
     });
    }
    and for the html button -
    Code:
    <input type="button" id="next5" title="Next 5 Records" disabled="disabled" value="Next 5>>" />

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    well, what records are shown by your function appear to be controlled by parameters from qstring, which is provided to show() when it is called, so it really depends on what data you are putting in the qstring.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •