0

我有以下表格声明:

<div class="edit-dialog span-10" style="display:none;">
  <div class="edit-message span-10" style="margin-bottom:30px;">
    <span>Editing: <a style="text-decoration:none"></a></span>
  </div>
  <?php
    echo $this->Form->create('Voicenote', array('action' => 'edit'));
    echo $this->Form->input('title', array(
      'div' => false,
      'class' => 'input-text recorder',
      'label' => array(
        'class' => 'inlined',
        'text' => ''
      ),
      'id' => 'VoicenoteEditTitle',
      'placeholder' => 'Title',
      'style' => 'margin-bottom:10px;',
      'onsubmit' => 'return false;'
    ));

    echo $this->Form->input('tags', array(
      'div' => false,
      'class' => 'input-text recorder',
      'id' => 'VoicenoteEditTags',
      'label' => false, 
      'placeholder' => 'Tags',
      'onsubmit' => 'return false;'
    ));
    echo $this->Form->button('Cancel', array(
      'class' => 'button medium blue',
      'id' => 'cancel-edit',
      'style' => 'float:left;margin-top:50px;'
    ));
    echo $this->Form->submit('Save', array(
      'class' => 'button medium blue',
      'id' => 'save-edit',
      'style' => 'float:right;margin-top:50px;'
    ));
  ?> 
  <input type="hidden" id="edit-container-index" value="">
</div>

它没有输出<form></form>标签,我已经在整个应用程序中以这种方式声明了我的表单,添加$this->Form->end()也不起作用,有什么线索吗?

编辑:明确声明<form></form>标签也不输出它们

编辑2:我注意到了一些非常奇怪的事情。我的页面上有 4 个有问题的表单,如果我删除了有问题的元素的渲染,我的另一个表单将不会呈现,紧随其后的那个。

4

2 回答 2

4

你有一个提交按钮。只需在您的 ctp 文件中的提交按钮后添加 end() 即可。

<?php 
echo $this->Form->create('users');
echo $this->Form->input('username');
echo $this->Form->input('password');
echo $this->Form->submit('login');
echo $this->Form->end();
?>
于 2011-10-08T20:27:11.170 回答
0

嗨,我想如果您将最后一个回声更改为

echo $this->Form->end( array(
  'label'=>'Save',
  'class' => 'button medium blue',
  'id' => 'save-edit',
  'style' => 'float:right;margin-top:50px;'
));

它应该工作

于 2011-10-08T10:00:04.100 回答