store value in checkbox from gridview

Ads
 

store value in checkbox from gridview

Please check the error... 

<%@ page language="java" import="java.sql.*" %>
<%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    Connection con=null;
    ResultSet rst=null;
    Statement stmt=null;

    try
        {
            String a="jdbc:odbc:lib";
        con=DriverManager.getConnection(a);
        stmt=con.createStatement();
    }

    catch(Exception e)
        {
        System.out.println(e.getMessage());
    }

                Statement st = con.createStatement();
                        rst=st.executeQuery("select * from books ");



%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <title>Books</title>
        <script language="javascript">

function validation()
 {
 var count=0;
 for(var i=0;i<document.admin.chbox.length;i++)
 {
 if(document.admin.chbox[i].checked)
 {
 count++;
 }

}

if(count==0)
 {
 alert("check the messages to delete & u had limited msg");
 //document.msgchbox.checkbox.focus();
 return false;
 } 
else
 {
 return true;
 }

}


</script>
    </head>
    <body bgimage="header.jpg">
        <form name="admin" method="post" action="deletepage.jsp" onsubmit="return validation()">
     <center>
            <h1><b><font color="white">Books Available </font></b></h1>
                      <input type="submit" value=" DELETE "/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </div>
            <table bgcolor="pink" border="1" cellspacing="0" cellpadding="0">
            <tr>

                            <th bgcolor="darkblue"> <font color="yellow">S No.</font></th>
                                <th bgcolor="darkblue"> <font color="white">Group</font></th>
                <th bgcolor="darkblue"><font color="white">Name</font></th>
                <th bgcolor="darkblue"><font color="white">Author</font></th>
                                <th bgcolor="darkblue"><font color="white">Publisher</font></th>
                                <th bgcolor="darkblue"><font color="white">Edition</font></th>
                                <th bgcolor="darkblue"><font color="white">Copies</font></th>
                                <th>Delete</th>

            </tr>
                <%
                int no=1;

                while(rst.next())

                                {
                %>
                <tr>


                                    <td><%=no%></td>

                  <td><%=rst.getString("group_")%></td>
                                    <td><%=rst.getString("name")%></td>
                  <td> <%=rst.getString("author")%> </td>
                                  <td> <%=rst.getString("publisher")%> </td>
                                  <td> <%=rst.getString("edition")%> </td>
                                  <td> <%=rst.getString("copies")%> </td>

                                 <td><input type="checkbox" name="chbox<%=no%>" value="<%= rst.getString("name") %>" ></td>
                </tr>
                <%



                no++;

                }
    rst.close();
    stmt.close();
    con.close();
%>
            </table>
                        <u><h2><a href="Books.jsp"><font color="white">Back</font></a></h2></u>
                        <u><h2><a href="home.html"><font color="white">Home</font></a></h2></u>
            </center> 
        </form>
    </body>
</html>
View Answers

Ads









Related Tutorials/Questions & Answers:
store value in checkbox from gridview
store value in checkbox from gridview  Please check the error... = con.createStatement(); rst=st.executeQuery("select * from books...; <input type="submit" value=" DELETE "/>&nbsp;&nbsp
how to retrieve a checkbox value(retrieve from DB)
how to retrieve a checkbox value(retrieve from DB)   I facing a problem with checkbox value that already exists inside the database. so how can I retrieve those value from another database table? the table subject and service
Advertisements
checkbox value in php
checkbox value in php  In my HTML,PHP form ..we have a check box that is working fine. But anyhow i am not able to get the value of it. Can anyone suggest how to get the value of checkbox in PHP
how to get the checkbox value in jsp
how to get the checkbox value in jsp  how to get the checkbox value in jsp?   JSP CheckBox Example - how to get the checkbox value in jsp
How to change the checkbox value dynamically.
How to change the checkbox value dynamically.  Hi, I am using struts 1.2 checkbox tag. Requirement is on page load the value must be "true... the page. Then the checkbox is checked instead it have to show unchecked. And even
To store value in session & display it
To store value in session & display it  Hello..I m trying to run...="add"> <!-- <input type="checkbox" name="book1cat" value="JSP" />JSP <input type="checkbox" name="book1cat" value="C
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  How to insert...;input name="activity7" type="checkbox" id="act_name" name="act_name" value... <input name="activity" type="checkbox" id="act_name" name="act_name" value
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  How to insert...="activity7" type="checkbox" id="act_name" name="act_name" value="caltural_night" />... name="activity" type="checkbox" id="act_name" name="act_name" value="batik
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  how to insert...="center"> <input type="checkbox" name="pmanager" value="Edit...; <input type="checkbox" name="pmanager" value="Deleted" checked><
jQuery to Select Multiple CheckBox
program that retrieves the value of selected checkbox from server and displays...;checkbox_name" value="English"> English<br> <input type="checkbox" name="checkbox_name" value="Hindi"
jQuery to Select Multiple CheckBox
program that retrieves the value of selected checkbox from server and displays...="checkbox_name" value="English">English<br> <input type="checkbox" name="checkbox_name" value="
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?   i want to store the value of jtable in multidimensional array,with type double. how to store jtable value in multidimensional array
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?   i want to store the value of jtable in multidimensional array,with type double. how to store jtable value in multidimensional array
code for selected checkbox columns data from database
code for selected checkbox columns data from database  in my page iam getting all column names of a particular table with checkboxes. when iam select one or more checkboxes i have to get data of that selected columns only. what
store dynamic generated textbox value into database
store dynamic generated textbox value into database  sir, how do i store dynamically generated textbox value into the database thanks in advance
store and retrive image from the database
store and retrive image from the database  please provide me... to store and retreive images from sql database using sql commands -how to store and retreive images from sql database using asp.net/c# thanks in advance
store html value in the sqllite 3 php
store html value in the sqllite 3 php  i have a php script that will parse html page content link and view but i need to know how to store... tell db to store html content from $articles $result = $db->query('SELECT bar
Reading Value From console
Reading Value From console  In case of String data Type readLine method of DataInputStream class read complete line of the given string but the next method of Scanner class doesn't read the complete line of String. why
Reading Value From console
Reading Value From console  In case of String data Type readLine method of DataInputStream class read complete line of the given string but the next method of Scanner class doesn't read the complete line of String. why
returning a value from Threads
returning a value from Threads  Hello I have worker pattern that uses ExecutorService to schedule Thread execution but getting stuck at some point when returning a value using Future.I have code snippet below: ExecutorService
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
store data from a variable in mysql?
store data from a variable in mysql?  sir last time asked you tell me how to retrieve data from a database mysql and store it in an int variable in order to apply some calculation on it, but now i want to store the result
passing value from javascript popup
passing value from javascript popup  How to take user input and pass that input value using popup in Javascript
read from file and store using hash map
read from file and store using hash map  I was stuck with a java project where I have to read a file with two different concepts and store them... (Key, value) ID, 123 (key, value) Children: Name, abc ID, 321 and so
Subtract a value in the database from java
Subtract a value in the database from java   Hi, i want to know how to subtract a value on a database. im using JDBC connection from access and i want to decrement the value of table "quantity" of 1 each time it passes a loop my
store & retrive the image from oracle database
store & retrive the image from oracle database  how can i store the image path in tha database & fetch that image from oracle database
export value in csv from jsp
export value in csv from jsp  Hi! i have creted a html form using javascript. i hv taken the array values in jsp. nw i want to pass these array values from jsp to csv file. so please help me how to send
Read the value from XML in java
Read the value from XML in java  Hi, i have an XML... the permissions on that file.So how can i read that value. This is little urgent.... <param name="file" value="D:/Lakki
How to save and get value from JSP
How to save and get value from JSP  Employee Name Time... 324 2012-12-12 save i want to save dis value jsp to action ...how can i get all value ..and store..how can its values goes
Return Value from One Form
Return Value from One Form  I have two buttons in main form client and bank.when i click client button new form will open, in this dedupe button... value of dedupe form and use in bank form..how to do
I want to store the value of local variable into Global variable
I want to store the value of local variable into Global variable    <%=cnt%>=x; is it a valid Statement

Ads