Hey, I've used $form->generateSelectDiv() to generated a select tag.
In my view file I can get the values from it easily using $html-
>tagValue.
However I'm using a findCount() in my controller thats return value is
based on what the user choses in the select tag. My problem is how
can I get the controller to use the value generated by the view?
Heres my controller code:
class DataPointsController extends AppController
{
var $name = 'DataPoints';
var $uses = array('DataPoint','DesWalk','ComProject','ComUser');
var $helpers = array('Html', 'Form');
function index()
{
// code to create the user ID list
$comUser = $this->ComUser->generateList('id');
$this->set('comUser', $comUser);
$sql = 'SELECT count(*) AS c FROM data_points AS Data_points
WHERE data_points.des_walk_id = 1';
// used to find the count based on the user id
$anInt = $this->DataPoint-
>findCount(array('DataPoint.des_walk_id' => Value that the user
selects from $comUser);
$this->set('data', $anInt);
}
}
and heres how I've created the select tag in my index view file:
<?php echo $form->generateSelectDiv('ComUser/id', 'User...',
$comUser); ?>
Can anyone help me with this?
Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---