Hi.
Benötige gerade dass erste Mal js und weiß nicht wie ich bei untenstehender Tabelle die jeweilige ID herausbekomme ?. Wie macht man dass mit Javasript , damit ich die zugehörige Zeile des jeweiligen Submit Buttons bekomme ?
bin für jede hilfe dankbar
lg
reinhardl
<SCRIPT type="text/javascript" language="javascript">
function deleteEntry(svnr)
{
self.location.href='addressBook.do?id=svnr';
}
</SCRIPT>
</head>
<body>
<!-- note how bare numbers or numbers with quotes -->
<table border="1">
<tr>
<th>
ID
</th>
<th>
FIRSTNAME
</th>
<th>
LASTNAME
</th>
<th>
EMAIL
</th>
</tr>
<c:forEach var="contact" items="${requestScope.contactList}">
<tr>
<td>
<cut value="${contact.id}"/>
</td>
<td>
${contact.firstName}
</td>
<td>
${contact.lastName}
</td>
<td>
${contact.email}
</td>
<td>
<input type="button" value="Zurücksetzen" onclick="deleteEntry(this.ID)">
</td>
</tr>
</c:forEach>
</table>
Benötige gerade dass erste Mal js und weiß nicht wie ich bei untenstehender Tabelle die jeweilige ID herausbekomme ?. Wie macht man dass mit Javasript , damit ich die zugehörige Zeile des jeweiligen Submit Buttons bekomme ?
bin für jede hilfe dankbar
lg
reinhardl
<SCRIPT type="text/javascript" language="javascript">
function deleteEntry(svnr)
{
self.location.href='addressBook.do?id=svnr';
}
</SCRIPT>
</head>
<body>
<!-- note how bare numbers or numbers with quotes -->
<table border="1">
<tr>
<th>
ID
</th>
<th>
FIRSTNAME
</th>
<th>
LASTNAME
</th>
<th>
</th>
</tr>
<c:forEach var="contact" items="${requestScope.contactList}">
<tr>
<td>
<cut value="${contact.id}"/>
</td>
<td>
${contact.firstName}
</td>
<td>
${contact.lastName}
</td>
<td>
${contact.email}
</td>
<td>
<input type="button" value="Zurücksetzen" onclick="deleteEntry(this.ID)">
</td>
</tr>
</c:forEach>
</table>
Comment