$form->create('Model', array('url' => '...', 'default' => false));
generates your form tag with onSubmit="event.returnValue = false;
return false;", which is what you need
On Dec 14, 2:15 pm, WordPress Guru <[EMAIL PROTECTED]> wrote:
> Hello ,
>
> I have a form that I am creating with form->create() , but I dont want
> the form to be submitted as their is an ajax button in the form that
> will [hopefully] submit the form. So I want to use onSubmit="return
> false;" to stop the form from submitting.
>
> I have tried the following, that does not work.
>
> echo $form->create('Model' , array('url'=>'/controller/action/'.
> $id.'/' , 'onSubmit'=>'return false;') );
>
> This was on the assumption that cake might be watching onSubmit inside
> create method. Ahh that api. document is not worth much :(
>
> Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---