Hi all,

         Iam a very new beginner to cakephp. Iam struggling with
multiple submit button in one form(via POST). This is my issue:

I have .ctp page with two submit button like this,

 <?php echo $form->create('Task', array('action' => 'home','type' =>
'post')); ?>
 <?php echo $form->submit('tasks.gif',array('name'=>'Task')); ?>
<?php echo $form->submit('Go',array('name'=>'Go')); ?>
 <?php echo $form->end(); ?>

I want to identify which button has clicked(Task button or Go button).
How can i identify this?I just tried like this..

And in my controller page I have an action "home" like this:
function home()
  {
                if (isset($this->params['form']['Task']))
                            {
                               echo("<SCRIPT LANGUAGE='JavaScript'>
window.alert(' Task') </SCRIPT>");


                            }
              if (isset($this->params['form']['Go']))
                            {
                               echo("<SCRIPT LANGUAGE='JavaScript'>
window.alert(' Go') </SCRIPT>");


                            }

  }

But failed .... can anyone plz help me. Struggling with this for last
few days!!!!!

Thanks



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to