其中一个表单位于每行的第三列,并且与每个添加的行完美配合。但是,在我将表单添加到标记后,添加按钮将不再单击,并添加一行。我尝试了很多东西,并发现如果我将代码移动到一个列并将其创建为一个帖子表单,它将单击,但不会创建一行。如果我将整行移到顶部(这没有意义),它仍然可以完美地运行。
我应该澄清导致效果接近顶部的形式,并且提交按钮是第35行附近的。
我已经发布了以下代码。如果有人能指出我正确的方向,我们将不胜感激。
<td class="centerMe" headers="actionEdit">
<c:if test="${action == 'addIt'}">
<form action="editPage" method="post">
<input type="hidden" id="id1" name="id1" value="${something.somethingId}" />
<input type= "image" img src="${contextPath}/img/edit_d1.gif" alt="Paper and pen icon. Edit ${something.somethingId}" title="Edit ${something.somethingId}"/>
</form>
</c:if>
<c:if test="${action == 'edit'}">
<c:if test="${something.somethingId == somethingId}">
<a href="#" onclick="submitForm('form');">
<img src="${contextPath}/img/save_d1.gif" onclick="submitForm('form1');" alt="Disk icon. Savechange" title="Save change"/>
</a>
<spring:url var="url" value="${servletPath}/adminCancel"/>
<a href="${url}" onclick="cancelled();">
<img src="${contextPath}/img/cancel_d1.gif" alt="Opposite arrows icon. Cancel change." title="Cancelchange" />
</a>
</c:if>
</c:if>
</td>
</tr>
</c:forEach>
<c:if test="${action == 'add'}">
<tr>
<td class="CenterMe">
<form:hidden path="somethingId" value="${somethingBean.nextSomethingId}"/>
${somethingBean.nextSomethingId}
</td>
<td class="LeftMe" >
<form:input path="description" class="inputTight" style="margin: 0px; padding: 0px;" title="Enter a new Description for Id ${somethingBean.nextSomethingId}"/>
<br/>
<form:errors path="description" class="errorText" />
</td>
<td class="CenterMe">
<input type="submit" value="Add" class="inputTight" title="Add new Id to Supported list"/>
</td>
</tr>
</c:if> </form>