置空所有的搜索框

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 ='' ;
				}
			}
		}
	}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值