store value in checkbox from gridview

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









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
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 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
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><
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
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
jQuery to Select Multiple CheckBox
program that retrieves the value of selected checkbox from server and displays... type="checkbox" name="checkbox_name" value="English"...;checkbox" name="checkbox_name" value="French">French<
jQuery to Select Multiple CheckBox
program that retrieves the value of selected checkbox from server and displays...="checkbox" name="checkbox_name" value="English">...;checkbox" name="checkbox_name" value="French"> French<
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
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
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
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
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
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
passing value from javascript popup
passing value from javascript popup  How to take user input and pass that input value using popup in Javascript
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
Code to store SubCombo box value - Development process
Code to store SubCombo box value   Hi ,In the following code i want to store SubCombo box name instead of value for Department Field. Add Data var arr = new Array(); arr["Select"] = new Array("-select-"); arr["Dkn
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
Store combo box value - Development process
Store combo box value  Hi , this is my code. Here wen i click submit button combo values are stored like 1,2,3... but i want to store value . plz send me code. while validating a form, i have entered data in first field
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
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
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
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
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
How to store and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one of my application I have to store and then display the image in JSP. How to store and retrieve image from database in JSP? Thanks   HI, You can use
How to Store Float Value into Access Database - Java Beginners
How to Store Float Value into Access Database  Hello sir,I want to Store Student Marks Percentage into Access Database in Float Value how i can Store.... To store the double value in Access database, you need to set the datatype
Retrieve Value from Table - Hibernate
Retrieve Value from Table   Hai friend, I need help, How can i retrieve values From database using hibernate in web Application. As I new to hibernate I couldn't find solution for this problem.. Can anyone help please.. 
Retrieving attribute value from XML
Retrieving attribute value from XML  I have an XML as below to parse...; ..... But am not able to fetch the value of LoadTicketId attribute. My code...://www.roseindia.net/xml/getting-text-values-from-a-nodel.shtmlADS_TO_REPLACE_3 http
retrieve data from mysql database and store it in a variable ?
retrieve data from mysql database and store it in a variable ?  sir... to store that data in int variable. how to do this ?   Here is an example that retrieve the integer values from the database and stored in the integer
store and retrive image from database - JDBC
store and retrive image from database  how to store and retrive an image in database using java?  Hi friend, Code for store image...()); } } } For retrieve image from database visit to : http
Store data in HTML forms from Excel sheet
Store data in HTML forms from Excel sheet  I have a excel file having multiple coloums, and having one Html page having forms corrospoding to excel coloums. I want to auto fill up the excel data into html forms, Any one please
Return Value From Event - Java Beginners
Return Value From Event  I would like to call a method that returns a value after an event has occurred and the value is determined by the event or listener. eg: public int mymethod() { static int value=0; KeyAdapter
how to store and retrieve image from database
how to store and retrieve image from database  how to store and retrieve images into database(oracle) and how to retrive images from database using jsp   Here is a jsp code that insert and retrieve image from mysql
code for insert the value from jsp to access database
code for insert the value from jsp to access database  code for insert the value from jsp to access database
related retrieving value from oracle database
related retrieving value from oracle database  how we get the value from database in the given textbox
related retrieving value from oracle database
related retrieving value from oracle database  how we get the value from database in the given textbox
Getting environment variable value from java
Getting environment variable value from java  Getting environment variable value from java
How to store two integer value in a separate file and retrieve those values
How to store two integer value in a separate file and retrieve those values  I need to save two values so i can use those values later i came up... can i write and update value in that file
access image from ajax store in mysql using jsp
access image from ajax store in mysql using jsp  access image from ajax store in mysql using jsp (code to access image captured by camera and store in mysql
How to store extracted values from xml in a database? - XML
How to store extracted values from xml in a database?  I want to store extracted xml values in a database... How can i store extacted xml values in a database... give me a example
How to store extracted values from xml in a database? - XML
How to store extracted values from xml in a database?  I want to store extracted xml values in a database... How can i store extacted xml values in a database... give me a example

Ads