Check out my Spring MVC JSP snippet below:
<c:forEach var="trackRecord" varStatus = "number" items="${contractDetails.trackRecordEntries}" >
<tr class="tafont">
<td class="varcar"><form:input readonly = "true" name = "installmentNo" id = "installmentNo" path="trackRecordEntries[${number.index}].installmentNo"/></td>
<td class="varcar"><form:input readonly = "true" name = "installmentAmount" id = "installmentAmount" path = "trackRecordEntries[${number.index}].installmentAmount"/></td>
<td class="varcar"><form:input readonly = "true" name = "dueDate" id = "dueDate" path="trackRecordEntries[${number.index}].dueDate"/></td>
<td class="varcar"><form:input cssClass="recievedDate" name = "recievedDate" id = "recievedDate" path="trackRecordEntries[${number.index}].recievedDate"/></td>
<td class="varcar"><form:input id = "recieptAmount" name = "recieptAmount" path="trackRecordEntries[${number.index}].recieptAmount"/></td>
<td class="varcar"><form:input id = "delayDays" name = "delayDays" path="trackRecordEntries[${number.index}].delayDays"/></td>
</tr>
</c:forEach>
This code connects an ArrayList of beans to the JSP page, but there is a challenge with using the 'name' attribute in the <form:input>
tag. The 'name' attribute is essential for JavaScript validation with
document.getElementsByName("name");
Looking for any solutions or workarounds?