日期:2014-05-16  浏览次数:21001 次

easyui 链接按钮提交表单问题?
我在chaxun.asp文件中使用这个按钮<a href="chaxun.asp" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onClick="javascript:this.form.submit();">查询</a>,没有效果,主要是开始日期和结束日期框中的内容不能记录下来,每次都是默认值。但是用
 <input    type="image"  src="jquery-easyui/themes/icons/search.png"   height="20" onclick="this.form.submit()"  alt="点击开始查询">   可以查询。

页面代码如下:

<% 
  datea=request("KSMonth")
dateb=request("JSMonth")
if datea="" then datea=DateSerial(year(now()),1,1)
if dateb="" then dateb=date()
 %>
 </head>

<body class="easyui-layout" fit="true" border="false">
<form id="searchForm" method="POST" action="chaxun.asp">
<div region="north" border="false"  style="height:100px;overflow:hidden" data-options="headerCls:'biaoti'">

<table class="datagrid-toolbar" style="width:100%; height:=100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#009966">
                    <tr>
                    <td> 开始日期:<input  name="KSMonth"   id="KSMonth" type="text" class="Wdate" size="14" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'JSMonth\',{d:0})}'})" value="<%if request("KSMonth")<>"" then%><%=request("KSMonth")%><%else%><%=DateSerial(year(now()),1,1)%><% end if%>"></td>
                    <td>结束日期<input input name="JSMonth" id="JSMonth" type="text"  size="14" onClick="WdatePicker({minDate:'#F{$dp.$D(\'KSMonth\',{d:0})}'})" class="Wdate"  value="<%if request("JSMonth")<>"" then%><%=request("JSMonth")%><%else%><%=year(now())%>-<%=month(now())%>-<%=day(now())%><%end if%>"></td>
                    <td align="center">
<a href="chaxun.asp" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onClick="javascript:this.form.submit();">查询</a>  <input    type="image"  src="jquery-easyui/themes/icons/search.png"   onclick="this.form.submit()" height="40" alt="点击开始查询">
</td>
                    </tr>
                </table>
</div>

<div region="center"  >
<table id="peixunjilu" width="100%" ></table>  
</div>
</form>
</body>



------解决方案--------------------
<a href="chaxun.asp" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onClick="javascript:this.form.submit();">查询</a>
改为
<a href="chaxun.asp" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onClick="javascript:document.getElementById("searchForm").submit();">查询</a>