java - Generating button trouble with JSP -
so have problem following jsp code.
while(rs.next()){ out.println("<tr>"); out.println("<td>" + rs.getstring(2) + "</td>"); out.println("<td> <button type='submit' value='delete' onclick = deleteobj(out, " + rs.getstring(2) + ")'>hi</button> </td>"); out.println("</tr>"); } here 1 can see function looks onclick="deleteobj(out, "fat ..etc, quote seems getting in way , unsure it.
http://i.imgur.com/z1d81cw.png
also wondering how server knows deleteobj jsp method. isn't same format javascript method calls on click?
thank you
the " persists right before second parameter why suspect fails not sure can do.
try:
out.println("<td> <button type='submit' value='delete' onclick = deleteobj(out, '" + rs.getstring(2) + "')>hi</button> </td>");
Comments
Post a Comment