Saturday, June 1, 2013

JS Link Submit or JS Submit with Class

I am trying to submit a form using CakePHP, but either I can't stylize the button correctly or the form will not submit.

Basically, this question is how to submit form with a stylized image/link/whatever using the cake routines.

Here's what I have so far:

    echo $this->Js->submit ($this->Html->tag ('i', '', array ('class' => 'icon-search icon-white')),
                            array ('update' => '#plot_area',
                                         'buffer' => false,
                                         'div' => false,
                                         'async' => true,
                                         'escape' => true,
                                         'url' => 'filterLayoutsList',
                                         'class' => 'btn btn-primary',
                                  ));

This submits the form correctly, but doesn't have my icon correct.

  echo $this->Js->link ($this->Html->tag ('i', '', array ('class' => 'icon-search icon-white')),
                                  array ('controller' => 'plots', 'action' => 'filterLayoutsList'),
                                  array ('update' => '#plot_area',
                                         'id' => 'linkSubmit',
                                         'escape' => false,
                                         'class' => 'btn btn-primary',
                                         'dataExpression' => false,
                                         'evalScripts' => true,
                                         'buffer' => false,
                                         'data' => $this->Js->get('#PlotFilterLayoutsListForm')->serializeForm ()
                                        ));

This looks right, but doesn't submit my form.

I feel like I am very close, but not there.

Thank you for any advice!

Joey

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: