Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix invisible buttons.

Fixes #2802
  • Loading branch information...
commit 94e83fa81c6eb0e25ec532a8b62244f09c2d02c5 1 parent e54e494
Mark Story markstory authored
3  lib/Cake/Test/Case/View/Helper/FormHelperTest.php
View
@@ -5974,7 +5974,7 @@ public function testButtonUnlockedByDefault() {
public function testPostButton() {
$result = $this->Form->postButton('Hi', '/controller/action');
$this->assertTags($result, array(
- 'form' => array('method' => 'post', 'action' => '/controller/action', 'accept-charset' => 'utf-8', 'style' => 'display:none;'),
+ 'form' => array('method' => 'post', 'action' => '/controller/action', 'accept-charset' => 'utf-8'),
'div' => array('style' => 'display:none;'),
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
'/div',
@@ -6000,7 +6000,6 @@ public function testSecurePostButton() {
$expected = array(
'form' => array(
'method' => 'post', 'action' => '/posts/delete/1', 'accept-charset' => 'utf-8',
- 'style' => 'display:none;'
),
array('div' => array('style' => 'display:none;')),
array('input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST')),
4 lib/Cake/View/Helper/FormHelper.php
View
@@ -1545,7 +1545,7 @@ public function button($title, $options = array()) {
/**
* Create a `<button>` tag with a surrounding `<form>` that submits via POST.
*
- * This method creates a `<form>` element. So do not use this method in some opened form.
+ * This method creates a `<form>` element. So do not use this method in an already opened form.
* Instead use FormHelper::submit() or FormHelper::button() to create buttons inside opened forms.
*
* ### Options:
@@ -1560,7 +1560,7 @@ public function button($title, $options = array()) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postButton
*/
public function postButton($title, $url, $options = array()) {
- $out = $this->create(false, array('id' => false, 'url' => $url, 'style' => 'display:none;'));
+ $out = $this->create(false, array('id' => false, 'url' => $url));
if (isset($options['data']) && is_array($options['data'])) {
foreach ($options['data'] as $key => $value) {
$out .= $this->hidden($key, array('value' => $value, 'id' => false));
Please sign in to comment.
Something went wrong with that request. Please try again.