<form action="${pageContext.request.contextPath }/backend/basic/ticketRule/ticketAuditer/add"
id="ticketAuditerForm" method="post">
<table id="companyType_add_table" cellpadding="0" cellspacing="0">
<tr>
<th >Carrier:</th>
<td id = "ticketAuditerCarrierAddInit"></td>
</tr>
<tr>
<th>user:</th>
<td align="left">
<input id="userNameAdd" name="auditer.userName" type="text" size="20" />
<input name="search" type="button" value="select" onclick="searchUser()" />
<input id="userIdAdd" name="auditer.id" type="hidden" size="20" value="3" />
</td>
</tr>
<tr>
<td colspan="2"><p class="validateTips" align="center">...</p>
<input type="hidden" name="id" id="id" value="" />
</td>
</tr>
</table>
</form>
然后我想在表单中添加一个隐藏元素:
<input type="hidden" id ="ticketTypeId" name ="ticketTypeId" value="${1}">
jQuery代码:
$("#searchTicketAuditer").button().click(function() {
$("#searchTicketAuditerForm").add("#ticketTypeId");
$("#searchTicketAuditerForm").submit(); })
当我提交表单时,我可以从表单中获取ticketTypeId,请帮助我!</p>