Spring Dynamic (Expandable) List form

穿精又带淫゛_ 提交于 2019-12-03 15:59:57

I found the reason why the form was not being submitted correctly. I noticed the following HTML in firebug:

<form id="researchquestion" method="post" action="/site/admin/researchquestion/"></form>

The form tag is closed immediately, so the HTML generated by spring was not correct. It appears that this was because the form was inside the table switching the <table> and <form:form> tags fixed the issue.

Original code

<table>
    <form:form action="${form_url}" method="post" modelAttribute="report">
         <!--  Code here -->  
    </form:form> 
</table>

Working version

<form:form action="${form_url}" method="post" modelAttribute="report">
    <table>
         <!--  Code here -->  
    </table>
</form:form>

In a <table> it is only allowed to use table related tags such as <tr> <th> and <td>. Which is probably why Spring immediately closed the <form> tag.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!