how can I create Cancel button ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how can I create Cancel button ?

aoohralex
I have action:
        public function addBookAction()
        {
                $form = new Form_Books();

                 if ($this->getRequest()->isPost())
                {
                        $request = $this->getRequest();
                        if ($form->isValid($request->getPost()))
                        {
                                .................
                        }
                }  

                $this->view->form = $form;
        }


And In form I have submit button:
       $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Submit',
        ));


How can I make Cancel button ? I think I can't make button cancel type 'submit' because after clicked this button it will be executed action addBookAction() and book will be added. So what is the solution ?
Reply | Threaded
Open this post in threaded view
|

Re: how can I create Cancel button ?

mark.wright
Is javascript available in your country?

Mark

On Sun, Sep 20, 2009 at 3:36 AM, aoohralex <[hidden email]> wrote:

>
> I have action:
>        public function addBookAction()
>        {
>                $form = new Form_Books();
>
>                 if ($this->getRequest()->isPost())
>                {
>                        $request = $this->getRequest();
>                        if ($form->isValid($request->getPost()))
>                        {
>                                .................
>                        }
>                }
>
>                $this->view->form = $form;
>        }
>
>
> And In form I have submit button:
>       $this->addElement('submit', 'submit', array(
>            'ignore'   => true,
>            'label'    => 'Submit',
>        ));
>
>
> How can I make Cancel button ? I think I can't make button cancel type
> 'submit' because after clicked this button it will be executed action
> addBookAction() and book will be added.
> --
> View this message in context: http://www.nabble.com/how-can-I-create-Cancel-button---tp25528935p25528935.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



--
Have fun or die trying - but try not to actually die.
Reply | Threaded
Open this post in threaded view
|

Re: how can I create Cancel button ?

aoohralex
Yes but I don't know where I should place library jQuery - in which catalog - for example in Symfony Framework and ASP.NET MVC default library is the most popular javascript library on the world - jQuery and I don't need to download, place and enable it but of course in Zend I must do it.

So I downloaded jQuery library and where I should place it ? In documentation there is nothing about that: http://framework.zend.com/manual/en/zendx.jquery.html
Reply | Threaded
Open this post in threaded view
|

Re: how can I create Cancel button ?

mark.wright
Dude, did you even read that ZendX_JQuery page? Seriously. Take
another look at the Introduction, 2nd paragraph (the one after the
bullets). If you can't find it look at the very bottom of the page
(you need to scroll to get there) above the horizontal rule separating
the main content from the Prev and Next links. The very last paragraph
above that horizontal rule is the one you want. Read the whole thing.
As Padraic said in another thread, read the docs before posting to the
mailing list. And I'll add another recommendation: do a little
experimentation on your own first.

Anyways, if you're going to use Zend Framework then get over Symphony
and ASP.NET or keep it to yourself. Listening to you going on and on
about them is getting old. Besides, all frameworks are different and
if you are fixated on one it will be much more difficult to learn
another.


Mark

On Sun, Sep 20, 2009 at 4:58 AM, aoohralex <[hidden email]> wrote:

>
> Yes but I don't know where I should place library jQuery - in which catalog
> (for example in Symfony Framework and ASP.NET MVC default library is the
> most popular javascript library on the world - jQuery and I don't need to
> download, place and enable it).
>
> So I downloaded jQuery library and where I should place it ? In
> documentation there is nothing about that:
> http://framework.zend.com/manual/en/zendx.jquery.html
> --
> View this message in context: http://www.nabble.com/how-can-I-create-Cancel-button---tp25528935p25529405.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



--
Have fun or die trying - but try not to actually die.