I researched how to submit a form via javascript but, in my case, I'm creating several forms based on a collection of data. I don't know the best way to reference the form ID.
<c:forEach
var="meeting"
items="${response.mMeetingList}"
begin="0"
end="5">
<div class="row">
<ul class="span4 unstyled">
<li>
<form name="mtgDetailsForm" action="/transporter/app/meeting/read" method="POST">
<input type="hidden" name="meetingId" value="${meeting.meetingId} }">
<a href="javascript: getMtgDetails()" class="row">
<div class="span1"><fmt:formatDate value="${meeting.startTime}" type="time" pattern="h:mm a"></fmt:formatDate></div>
<div class="span3">${meeting.meetingName}</div>
</a>
</form>
</li>
</ul>
</div>
</c:forEach>
And here's the JS method for submitting the form:
function getMeetingDetails( data ){
document.mtgDetailsForm.submit();
}
Obviously, this will not work because the form ID will be duplicated. What's a better approach?
Thanks for any tips!