I’m trying and searching now for days and can’t find an answer.
My problem is this: I use a Hyperlink and Javascript to submit a form, but I also need to submit a parameter with the link. The code looks like this:
<form action="Action.jsp" method="post" id="form-id">
<input .../>
...
<c:forEach items="${items}" var="item" varStatus="vs">
<a href="Action.jsp?id=${vs.count}"
onclick="javascript:document.forms['form-id'].submit(); return false">
${vs.count}
</a>
</c:forEach>
</form>
If I leave away the return false the param id is transferred but the other <input .../> parameters not and vice versa. How you see I can’t use a <input type="hidden" .../> param, because I need only the param of the link.
If you please could help me, I would be grateful….
If you add a hidden
inputoutside the loop, you can set the value of that input before submitting: