Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet store value in checkbox from gridview
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


himanshu jaiswal
store value in checkbox from gridview
0 Answer(s)      a year and 9 months ago
Posted in : JSP-Servlet


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>

Advertisement
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
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
Advertisements
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><
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...;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="
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
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
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 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 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
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
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
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
How to display gridview details to labels dynamically?
How to display gridview details to labels dynamically?  I am using SQLDataSource to connect to MySQL. I have a gridview that retrieves information from MySQL database based on a selected id(dropdownlist). I need to display
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
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
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
CheckBox in Flex4
CheckBox in Flex4: In Flex 4 the CheckBox Control is comprises from... or not. You can change the value of a  text label to a CheckBox control... .The default value of Checkbox is unchecked. Checkbox value is true when it is checked
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
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
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
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
 

 

 

DMCA.com