Apologies Grant, I've just read another post you replied to "Multiple
Action in View with Checkbox on Grid" which has solved my problem.
Thanks
On Jun 27, 2:52 pm, mussond <[EMAIL PROTECTED]> wrote:
> Thanks for the quick reply, I've been away from this project.
>
> I'm still stuck, I'm guessing I've got a syntax error somewhere, I'm
> not sure if I should put $this->params['form']['button_name' in my
> index.thtml or my controller.
> Either way when I do I get an error message saying:
> Notice: Undefined index: Run Single user Report in /Library/WebServer/
> Documents/cake/app/controllers/data_points_controller.php on line 15
> or
> Notice: Undefined index: a in /Library/WebServer/Documents/cake/app/
> views/data_points/index.thtml on line 16
>
> Heres my index.thtml code:
>
> <h1>Number of Sounds</h1>
>
> <p><b>Select a Report Type and its options . . .</b></p>
> <br>
>
> <?php
> echo $html->selectTag('ComUser/id', $comUser, $html->tagValue('ComUser/
> id'), array(), array(), false);
> echo $html->submit('Run Single user Report');
> echo $html->submit('Run Boulder users Report');
> echo $html->submit('Run ALL users Report')?>
>
> <?php
> if ($this->params['form']['Run Single user Report'])
> {
> echo "Hi";
> }
> ?>
>
> Heres what I have if I put if statement in the controller:
>
> <?php
> class DataPointsController extends AppController
> {
> var $name = 'DataPoints';
> var $uses = array('DataPoint','DesWalk','ComProject','ComUser');
> var $helpers = array('Html', 'Form');
>
> function index()
> {
> $this->DataPoint->recursive = 0;
> $this->set('datapoints', $this->DataPoint->findAll());
> $comUser = $this->ComUser->generateList('id');
> $this->set('comUser', $comUser);
> if ($this->params['form']['Run Single user Report'])
> {
> echo "Hi";
> }
> }
> ?>
>
> On Jun 21, 6:51 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > I take it you would normally look at $_POST['button_name'] to see if
> > it was submitted, if so it was the one that was clicked. You can do a
> > similar thing in Cake, just make sure the button has a unique name
> > when you add it, and look in $this->params['form']['button_name'].
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---