jsp代码
<form id="form1" name="form1" action="" method="post">
<table class="editForm">
<tr>
<th width="10%">
</th>
<td width="20%">
<input type="text" id="Name" name=""
placeholder="" class="input" value="" />
</td>
<th width="10%">
</th>
<td width="30%">
<input type="text" id=""
name="" placeholder=""
class="input" value="" />
</td>
<th width="10%">
</th>
<td width="20%" class="colspan-3">
<input type="text" id="" class="select" name="" placeholder=" ---请选择---" value="" style="width:76%" readonly="readonly" />
<input type="hidden" id="deptId" name="" value="" />
<ul id="treeDemo" class="ztree" style="margin-top: 0; positon: relative; z-index: 99999;"></ul>
</td>
</tr>
<tr>
<th>
</th>
<td>
<input type="text" id="" name=""
placeholder="" class="input" value="" />
</td>
<th>
</th>
<td>
<input type="text" id="t"
name="" placeholder=""
class="input" value="" />
</td>
<th>
</th>
<td>
name="" id="e"
type="" value="">
</td>
</tr>
<tr>
<th>
</th>
<td>
<input type="text" id="" name=""
placeholder="" class="input" value="" />
</td>
<th>
</th>
<td>
<input type="text" id="" name="" placeholder="" value="" style="width:130px;" onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'jcDateEnd\')}'})"/>
<span style="text-align: left;">至</span>
<input type="text" id="jcDateEnd" name="search_LTE_jc_date" placeholder="结束时间" value="${searchParam['LTE_jc_date']}" style="width:130px;" onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'jcDateStart\')}'})"/>
</td>
<td colspan="2" style="text-align: right;">
<a class="btn" οnclick="serchBycond()">搜索</a>
<a class="btn" οnclick="resetForm(form1)">重置</a>
<a id="btnAdd" class="btn" href="#" οnclick=""><i class="ico"></i>导出</a>
</td>
</tr>
</table>
</form>
script代码
function resetForm(form) {
if (form) {
var eles = form.elements;
for (var i = 0; i < eles.length; i++) {
if (eles[i].tagName == 'INPUT') {
if (eles[i].type == 'text' || eles[i].type == 'textarea' || eles[i].type == 'hidden')
eles[i].value = '';
} else if (eles[i].tagName == 'SELECT') {
eles[i].selectedIndex ='' ;
}
}
}
}