CS5.5 want to change the number records returned for a repeat region from user input
Hello,
I am looking to allow the user to set the number of rows returned in a repeat region from the fixed amount set using Server Behaviours to a figure set by the person viewing the page.
I have seen that the code generated uses:
$maxRows_rsVenues = 20;
To start with I thought something simple. Either all records or the preset 20 rows at a time. I presume SESSION variables would be a good way to go so setting a form on the page with a checkbox (checked meaning ALL and unchecked for 20). (It gets me into how the coding works)
Having googled my requirement and read responses on using checkboxes and session variables I had the following theory
At start of page make sure session value exists:
if (!isset($_SESSION))
{
session_start();
}
$_SESSION['listcount']='20';
In the body before the table created within the repeat region put
<form id="form1" name="form1" method="post" action="">
<p id="frmFilter">
<input name="SeeAll" type="checkbox" id="SeeAll" value="1" />
<label for="SeeAll">SeeAll</label>
<input type="submit" name="Set Filter" id="Set Filter" value="Set Filter" />
</p>
</form>
<?php
if (isset($_POST['Submit'])) {
if ($_POST['SeeAll'] == '1')
{
$_SESSION['venuelistcount'] = '999999';
} else {
$_SESSION['venuelistcount'] = '20';
}
}
?>
<?php echo "LIST COUNT: ".$_SESSION['venuelistcount']; ?>
The problem is the Session variable never seems to be modified. Can someone explain what I have misunderstood, or perhaps a better option to implement what I want.
Thanks
