I have a web page that is a guest book listing. I want to show 5 guestbok entires at a time. Then there is a Next button at the top of the page. There is an onclick() that goes to a javascript Next() function. The Javascript next function calculates the next five record pointers to pass back to this same web page by the get method. IE. If I am on entries 1 thru 5 then I need to pass 6 and 1o this screen and redisplay the next 5 entries.
I can read the two variables I have passed $Beg and $End and they are there. I use Isset(). Where do I store these variables so that javascript can read them later when I hit the Next() function again?
I tried using a text field - hidden - with the name BegCount and another with the name EndCount. Is this how I should store the data in hidden text fields on the form? For some reason the text fields don't get set.
I know the javascript can read the text fields OK if I assign them a value.
Here is my php code at the beginning of the form:
<?
// Get the limits
if (isset($Beg)) {
echo "beg is set and is = " . $Beg;
$BegCount = $Beg;
$iBeg = $Beg;
echo "begcount is set and is = " . $BegCount;
} else {
$BegCount = "1";
$iBeg = 1;
};
if (isset($End)) {
$EndCount = $End;
$iEnd = $End;
} else {
$EndCount = "5";
$iEnd = 5;
}; ?>
iBeg and iEnd are for the for statement to get the next 5 guestbook entires. The statement $BegCount = $Beg; doesn't seem to put the value in the input field with the same name.
What am I missing here? How do you guys do this simple task of showing x entries at a time and then jumping back to same form with a new beg and end parameters?
TIA