<pre name="code" class="plain"><form id="centerMonthReport" action="${ctx}/exportMonth/oneReport" method="POST">
<table>
<tr>
<td><label>${i18N_sdsTime}</label></td>
<td><jvform:Monthfield id="date" value="${date}" title=""></jvform:Monthfield></td>
<td>${i18N_exportType}</td>
<td><jvform:select id="monthType" title="" optionsType="2" options="${typeList}"></jvform:select></td>
<td>文件类型</td>
<td><jvform:select id="fileType" title="" optionsType="2" options="${fileTypeList}"></jvform:select></td>
<td>
<div class="control-group">
<div class="controls">
<input type="button" value="${i18N_exportMonthReport}" class="btn-success" οnclick="submitform2()">
<span style="white-space:pre"> </span></div>
</div>
</td>
</tr>
</table>
</form>
function submitform2() {
var cen = $("#monthType").val();
if (cen == null || cen == '') {
alert("请选择要导出月报的类型");
} else {
var filetype = $("#fileType").val();
if(filetype == null || filetype == ""){
alert("请选择要导出的文件类型");
}else{
if("pdf"==filetype){
$("#centerMonthReport").attr("action","${ctx}/exportMonth/oneReport").submit();
<span style="white-space:pre"> </span>//这里若不重新设置action,在执行下面的action后,action就会是下面的action
}else if("excel"==filetype){
$("#centerMonthReport").attr("action","${ctx}/exportMonthExcel/export2").submit();
}
}
}
}