我有以下表单声明:
<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个表单有问题,如果我删除了有问题的元素的渲染,我的另一个表单将不会渲染,紧接着它的那个。
发布于 2011-10-09 04:27:11
您有一个提交按钮。只需在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-08 18:00:04
嗨,我想如果你把最后一个回声改成
echo $this->Form->end( array(
'label'=>'Save',
'class' => 'button medium blue',
'id' => 'save-edit',
'style' => 'float:right;margin-top:50px;'
));它应该是可行的
https://stackoverflow.com/questions/7692936
复制相似问题