I need to get the values from my rows inside the table of a jsp page and display it in textbox of another jsp page i tried to do but i could manage to just call my another page but could not able to get the values from one page to another
My Jquery
$('tr').click(function () {
$('tr').removeClass('selected');
$(this).addClass('selected');
selectedRow = $(this);
});
$("tr").dblclick(function () {
var td = $(selectedRow).children('td');
for (var i = 0; i < td.length; ++i) {
/* alert(i + ': ' + td[i].innerText); */
}
var customer =td[0].innerText
alert('customer :' +customer);
window.location = "InternalConversion.jsp?customer="+customer;
});
JSP page
<table style="width: 100%;" class="embeddedFIXED" >
<thead>
<tr >
<th align="left">Branch</th>
<th align="left">City</th>
<th align="left">Country</th>
<th align="left">Branch Number</th>
<th align="left">Entity Type</th>
</tr>
</thead>
<tbody>
<%
BranchSearch b1= null;
int rownum = 1;
Iterator<BranchSearch> i = l1.iterator();
while (i.hasNext()) {
b1 = (BranchSearch)i.next();
String rowStyle = "TIRowAlt";
if (rownum % 2 == 0) {
rowStyle = "TIRow";
} else {
rowStyle = "TIRowAlt";
}
%>
<tr class="link1 <%=rowStyle%>" onclick="click()">
<td align="left" class="br" ><%=b1.getBranch()%></td>
<td align="left"><%=b1.getCity()%></td>
<td align="left"><%=b1.getCountry()%></td>
<td align="left"><%=b1.getBranchnumber()%></td>
<td align="left"><%=b1.getEntitytype()%> </td>
</tr>
<%
rownum++;
}
%>
</tbody>
</table>
Aucun commentaire:
Enregistrer un commentaire