Re: JS Helper Submit method. Easy, but how do i add to it?

2010-11-13 Thread #2Will
So I think this might be easier just to write using jquery on its
own.  Cake has written the bind for me, and ive given the button an id
so it won't regenerate a random id each time.

i nipped into the souce, stole what cake had done so far.  made the
submit a simple Form->submit rather than Js->submit and did this :

Js->buffer($a);

?>


Which seems straightforward enough, unless someone clever thinks this
is a stupid way to do it, Self rescue!



On Nov 14, 2:33 pm, "#2Will"  wrote:
> Hi,
>
> I have a simple submit button magicly turning my form into ajax:
>
> echo $this->Js->submit('Add', array('update' => '#update-zone-phone',
> 'class'=>'zebidee', 'url'=>'/phones/add'));
>
> works really well.
>
> But, how do i add to what happens when that button is clicked?
>
> I'd like to reset the form and hide it. so $('#phones_add_box').hide()
> and $('#PhoneAddForm')[0].reset();
>
> but where should i put extra jquery code to add it to the submit
> button's click function?
>
> Thanks,
>
> will

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


JS Helper Submit method. Easy, but how do i add to it?

2010-11-13 Thread #2Will
Hi,

I have a simple submit button magicly turning my form into ajax:

echo $this->Js->submit('Add', array('update' => '#update-zone-phone',
'class'=>'zebidee', 'url'=>'/phones/add'));

works really well.

But, how do i add to what happens when that button is clicked?

I'd like to reset the form and hide it. so $('#phones_add_box').hide()
and $('#PhoneAddForm')[0].reset();

but where should i put extra jquery code to add it to the submit
button's click function?

Thanks,

will

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