hi,
give the submit button a name
and use it in the IF condition it works.

<input type=submit name=mmmmm />


if(mmmmm)
{fdkjghkgjndfkghkg}



On Wed, Aug 4, 2010 at 6:36 AM, Tomfox Wiranata
<tomfox.wiran...@gmail.com> wrote:
> i did react on form submitting a bunch of times....but it seems
> different since there is no input field.......
>
> do i need to place just a button without a form? seems to make sense.
> dont know if that is possible!!?
>
> On 4 Aug., 15:19, Tomfox Wiranata <tomfox.wiran...@gmail.com> wrote:
>> hi everyone,
>>
>> this seems really easy, but it's giving me a headache. I have a
>> function in my controller:
>>
>> function createABC() {
>>
>> // save stuff in database
>>
>> }
>>
>> this function is triggered by a form in a view, named createABC.ctp.
>> like this
>>
>> echo $form->create('ABC', array('action' => 'createABC'));
>> echo $form->button('save', array('type' => 'submit'));
>> echo $form->end();
>>
>> now, I do not want to start the saving procedure everytime the view is
>> called. so i wanna check if this button is hit first. if it is, then
>> save all the data. so i tried to check it like that:
>>
>> function createABC() {
>>
>>    if (!empty ($this->data)) {
>>       // save stuff in database
>>    }
>>
>> }
>>
>> it does not work. anybody know why?
>>
>> huuuge thx
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to