1

I have a page with two buttons for creating a pdf and an excel. But only one of them will work. The forms are nearly the same. How can I make both buttons work. Maybe with an id for the forms? Javascript?

<portlet:actionURL var="createExcel">
<portlet:param name="action" value="createExcelorConstrainSearch" />
</portlet:actionURL>
<portlet:actionURL var="createPdf">
<portlet:param name="action" value="createPDForConstrainSearch" />
</portlet:actionURL>

<form:form commandName="tg35FormBackingModel" action="${createExcel}" method="post">
<form:form commandName="tg35FormBackingModel" action="${createPdf}" method="post">
<div>
<table>
<tr>

....

</form:form>
</form:form>

<button type="submit" name="PDF"></button>
<button type="submit" name="EXCEL"></button>
4

1 回答 1

0

您可以向表单添加一个name属性,这将使它们都可以工作(但不能同时工作)。name您可以通过读取与表单数据一起发送的值来检查服务器端按下了哪个值。

于 2013-03-28T19:45:31.167 回答