jsp - Javascript not working!! cannot redirect to java page -
<script type="text/javascript"> function editrecord(id) { url="editrecord"; window.location.href = "http://localhost:8084/bookstore/" +url+ "?id" + id; return false; } </script> <tr> <% string s = (string) itr.next();%> <td> <%=s%> </td> <td> <%=itr.next()%> </td> <td> <%=itr.next()%> </td> <td> <%=itr.next()%> </td> <td> <%=itr.next()%> </td> <td><input class="dr-input" type="submit" value="edit" name="edit" onclick="editrecord(<%=s%>)"></td> <td><input class="dr-input" type="submit" value="delete" name="delete" onclick="deleterecord(<%=s%>);"></td> <% }%> </tr>
what want is, when click button(edit) should redirect servlet page(editrecord.java). above code in jsp. button doesnt redirect specified page. what's wrong code? there other way deal this?
Comments
Post a Comment