Note that there are some explanatory texts on larger screens.

plurals
  1. PObutton does not display alert box in jsp
    primarykey
    data
    text
    <p>i want to have a button in my table and when i press that button i want a alert or message to appear.i have tried onclick event but still it does not work.. this is my code..the alert is in the last column</p> <pre><code>&lt;% Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/engbooks","root",""); Statement stmt=con.createStatement(); ResultSet rs=stmt.executeQuery("select * from books"); while(rs.next()){ out.print("&lt;tr&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(1)+"&lt;/td&gt;&lt;td style='border-style: solid;'&gt;&lt;a onclick=incq('d','"+ rs.getString(3)+"')&gt;remove&lt;/a&gt; "+rs.getString(11)+" &lt;a onclick=incq('g','"+ rs.getString(3)+"')&gt;add&lt;/a&gt;&lt;/td&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(2)+"&lt;/td&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(4)+"&lt;/td&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(6)+"&lt;/td&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(7)+"&lt;/td&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(8)+"&lt;/td&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(9)+"&lt;/td&gt;&lt;td style='border-style: solid;'&gt;"+rs.getString(10)+"&lt;/td&gt;&lt;td&gt;&lt;img src='image1.jsp?imgid="+ rs.getString(1)+ "&amp;imgid1="+ rs.getString(3)+ "' width='50' height='50'&gt;&lt;/td&gt;&lt;/td&gt;&lt;td style='border-style: solid;'&gt; &lt;input type=submit value=buy onclick="alert('')"&gt; &lt;/td&gt;&lt;/tr&gt;"); } %&gt; </code></pre> <p>please help me and tell me if i am not clear</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload