无法在codeigniter

时间:2015-08-02 15:47:09

标签: php forms codeigniter reset

我使用三种不同的方法来重置我的表单,但是在单击按钮后仍然没有任何反应,这是我的表单的结构: 任何帮助将不胜感激

$this->load->helper('form');
$attributes = array('class' => 'form-inline', 'id' => 'ProductForm');
echo form_open_multipart("product/process/$id",$attributes);
.
.
.
<?php echo  form_reset(array('id'=>'reset','value'=>'resetme'));?>        
<button onclick="ResetForm();">Reset Form</button>
<button type="reset" value="Reset">Reset</button>
<?php echo form_close();?>
<script>
function ResetForm() {
    document.getElementById("ProductForm").reset() ;
}
</script>
//same for form_open()

3 个答案:

答案 0 :(得分:0)

您是否也尝试过

<input type="reset" value="Reset">

答案 1 :(得分:0)

@Mahdi Younesi:只需使用输入类型重置,然后测试它将重置表单元素。

答案 2 :(得分:0)

首先在表单中添加一些输入类型以测试重置功能

这是解决方案

在表单中添加一个输入而不是

替换form_reset(array(&#39; id&#39; =&gt;&#39; reset&#39;)); to form_reset(array(&#39; id&#39; =&gt;&#39; reset&#39;,&#39; value&#39; =&gt;&#34; resetme&#34;));

相关问题