php - Symfony2 isClicked() always false -
i'm trying implement isclicked() feature of submit buttons in symfony2. followed documentation doesn't work me. false.
form:
$builder ->add( 'draft', 'submit' );
controller:
$form = $this->createform( new pagetype(), $page ); $form->handlerequest($request); if ($form->isvalid()) { // set status draft if draft button clicked if ($form->get('draft')->isclicked()) { $page->setstatus(page::status_draft); } }
did miss something?
okay that's stupid. added script long time ago:
$("form").submit(function () { $('[type=submit]', this).attr('disabled', true); });
i used avoid multiple clicks on submit buttons. if button disabled won't add together post request. that's why failed. xurshid29 solution wouldn't help issue because php never know button clicked when it's not part of request.
php symfony2
No comments:
Post a Comment