Home Answers Viewqa JSP-Servlet dynamic multiplecheckbox values insertion

 
 


raghavendra
dynamic multiplecheckbox values insertion
1 Answer(s)      2 years and 11 months ago
Posted in : JSP-Servlet

hi

How to insert dynamically generated checkbox values to store in mysql data base using jsp?
View Answers

June 11, 2010 at 1:41 PM


Hi Friend,

Try the following code:

1)checkbox.jsp:

<html>
<form method="post" action="checkinsert.jsp">
<table>
<tr><td>Name:</td><td><input type="text" name="name"></td></tr>
<tr><td>Gender</td><td><input type="radio" value="Male" name="gen">M <input type="radio" value="Female" name="gen">F</td></tr>
<tr><td>Languages</td><td><input type="checkbox" name="lang" value="Hindi">Hindi<input type="checkbox" name="lang" value="English">English<input type="checkbox" name="lang" value="French">French<input type="checkbox" name="lang" value="German">German</td></tr>
<tr><td><input type="Submit" value="Submit"></td></tr>
</form>
</html>

2)checkinsert.jsp:

<%@page import="java.sql.*"%>
<%
String name=request.getParameter("name");
String gender=request.getParameter("gen");
String checkValues[]=request.getParameterValues("lang");

try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/register";, "root", "root");
String value="";
for(int i=0;i<checkValues.length;i++){
value+=checkValues[i]+" ";
}
Statement stmt = con.createStatement();
int j=stmt.executeUpdate("insert into person1(name,gender,languages) values('"+name+"','"+gender+"','"+value+"')");
out.println("inserted succesfully");
}
catch(Exception e){}
%>

Thanks









Related Pages:
dynamic multiplecheckbox values insertion - JSP-Servlet
dynamic multiplecheckbox values insertion  hi How to insert dynamically generated checkbox values to store in mysql data base using jsp?  Hi Friend, Try the following code: 1)checkbox.jsp: Name
dynamic delete and insertion in tables
dynamic delete and insertion in tables  hey... i have a problem..I am working on a problem management system..my code for a particular jsp page is as follows in this page i want to show the admin the already present records
dynamic delete and insertion in tables
dynamic delete and insertion in tables  hey... i have a problem..I am working on a problem management system..my code for a particular jsp page is as follows in this page i want to show the admin the already present records
Insertion into database
Insertion into database  Hi, I need code for inserting the multiple select box values into database.Please do send me the code. Thanks for ur immediate replies its helping a lot
Dynamic Proxies - Short Tutorial
Dynamic Proxies - Short Tutorial 2001-01-18 The Java Specialists' Newsletter [Issue 005] - Dynamic Proxies - Short Tutorial Author: Dr. Christoph G... from me, here is a "Short Tutorial to the Java2 platform Dynamic Proxy
insertion in SQL - SQL
insertion in SQL  Hi! Everybody... i have a problem with sql insertion. When i am inserting values through command i.e. insert into employee values(,,,,); here i want to insert ' in employee name column of database
Insertion Sort In Java
to sort integer values of an array using insertion sort. Insertion sorting algorithm is similar to bubble sort. But insertion sort is more ... Insertion Sort In Java      
insertion error - JSP-Servlet
insertion error  my first jsp page : In this i m getting all the values through a method called getAllDetails,the values are getting inserted... the values are getting inserted that is null values are getting inserted before
insertion in SQL - SQL
insertion in SQL  Query is "insert into employee values('"+eno+"','"+ename+"');" in the ename place we will get employee names such as John's... = "INSERT employee (username)VALUES('"+str+"')"; System.out.println(sql + sql
do not repeat values in databse during insertion using php and javascript
do not repeat values in databse during insertion using php and javascript ... sql.php and form.jsp. i want to do insert values into mssql database from user input form. sql.php is able to insert the values into database. i have connected
how to store a dynamic values - JSP-Servlet
how to store a dynamic values  Dear sir, i have a ArrayList in that i have stored a values from a excel sheet specified column values and i... and bonus is ~5 . Thanks Hr in another arraylist i have a values ~2,~3
Binary search tree (insertion) urgent!!
Binary search tree (insertion) urgent!!  Create a program... in Java.Avoid duplication of values when inserting nodes in the tree. When a new leaf.... Assume a binary search tree is constructed from the values 14, 35, 2, 3, 39
Insertion Sort Java
Insertion Sort in Java is an algorithm that is used to sort integer values..., Insertion Sort in Java is less efficient when it comes to larger data sets. In insertion sorting, algorithm divides the elements in two parts, one which
How to insert dynamic textbox values into database using Java?
How to insert dynamic textbox values into database using Java?  Hi I am trying to insert dynamic textbox values to database, my jsp form have 2... these dynamic textbox values to database(Oracle 11g)...Please help me out. I have
Insertion of multiple row data for billing purpose.
Insertion of multiple row data for billing purpose.  Hi , I have a hrml page . with 4 input text field as a 4 column and 4-5 rows... is that the no of text field in row/column can be dynamic. so how can i insert all
PHP SQL Insertion
PHP SQL Insertion       PHP SQL Insertion is used to execute MySQL queries in PHP script.... Understand with Example The Tutorial illustrate an example from 'PHP SQL Insertion
writing querries qnd connecting for insertion, accessing....
writing querries qnd connecting for insertion, accessing....  i created my front ends using html, and my back end using oracle 10g, i dont know how...(); int i=st.executeUpdate("insert into user(name,address) values
STRUTS2 Dynamic data is not updated
STRUTS2 Dynamic data is not updated  Hi All, I am new in struts and try to make an application in struts2. Need help on dynamic data content... get method it will return the null value of hard coded values. Please help
STRUTS2 Dynamic data is not updated
STRUTS2 Dynamic data is not updated  Hi All, I am new in struts and try to make an application in struts2. Need help on dynamic data content... get method it will return the null value of hard coded values. Please help
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  write a program in java using insertion sort
insertion sort
insertion sort  how many arrays needed for insertion sort and why
dynamic display - JSP-Servlet
dynamic display  hi, i want to display dynamic values in drop drown box in a jsp page.these values are in the form of arraylist's object which came form another servlet or bussiness logic after being validated
Generating dynamic fields in struts2
Generating dynamic fields in struts2  Hi, I want generate a web page which should have have some struts 2 tags in a group and a "[+]" button... to read those field values in controller? Please provide me some example
Dynamic check box problem
Dynamic check box problem  In my project i have used a dynamic table, in the each row of that table there is one check box [that i have created dynamically]. Now my problem is that i can't access those values from that dynamic
second selectbox of dynamic
second selectbox of dynamic  hello friends i hava a code like this and could any body help me with editing code and send me code. i am getting city values but i can't location values of city from database.thanks in advance
how to insert value in dynamic table
a dynamic table for every company.but whenever i'm inserting values to the company...how to insert value in dynamic table  i am creating a project...,status,marks) values(?,?,?,?,?)"); and i put all those firstname,lastname from
JavaScript Dynamic Combo Box
JavaScript Dynamic Combo Box Here we are going to create dynamic combo box... and combo2 represents the cities. The values of the combo boxes are stored...: On selecting the value from the first combo, related values will get displayed
Calendar window is not showing the textbox values for the Dynamic rows in html page - Java Interview Questions
Calendar window is not showing the textbox values for the Dynamic rows in html page  My code is here now.When i click on calendar ,value.../Remove dynamic rows in HTML table window.history.forward(1
Dependant & dynamic drop down list
Dependant & dynamic drop down list  I don't know this should be in this or AJAX forum. I have one dynamic drop down list from data base (working... on the values selected by user in first drop down list. How to achieve this ?   
Insertion Sort Applet
Insertion Sort Applet  Please All , I need Insertion sort applet program
Insertion Sort Applet
Insertion Sort Applet  I need Insertion Sort Applet code was design by Dr. Daniel Liang Please
insertion sort applet code
insertion sort applet code  i need Insertion Sort Applet Program
Remove duplicate values
. q1. how can i eliminate duplicate values during insertion? please i need code...Remove duplicate values  i am trying to insert values into database... is primary key. other attributes can allow null. am trying to insert values
java with jsp and dynamic database retrival for bar charts
java with jsp and dynamic database retrival for bar charts  Hi, I... dynamically for the table values logintime and userid from database.. can u please send me the code for this. very urgent! have to get the values dynamically from
Insertion Sort Timer
Insertion Sort Timer  Welcome all I wanna program in java find the timer of insertion sort and find time complexity for random value thanks all
File insertion into oracle database
File insertion into oracle database  How to Read and Insert a file (any format) into a Oracle database
passing values - JSP-Servlet
No: this is my java page for insertion package CHB; import..._DataInsertion(Name,Hallno,Time,Date,Mobileno,Status) values('"+name+"','"+hallno+"','"+time
hibernate insertion problem - Hibernate
hibernate insertion problem  Hi , Thanks for the material .Its very gud . when i run FirstExample.java i get the message insertion has been done int the table contact . but whne i look into database data is not inserted
how to create a dynamic website - Servlet Interview Questions
how to create a dynamic website  create a dynamic website of a topic of your choice. Web technologies to be used should include: HTML, JavaScript...,address,email) values('"+empname+"','"+midname+"','"+lastname+"','"+address
Creation and insertion in table
CREATION OF  TABLE,INSERTION &DISPLAY OF DATA  USING SQL... = statement.executeUpdate(QueryString);     // sql query to insert values in the specified table.     QueryString = "INSERT INTO user1(User_Name,UserId,User_Pwd)  VALUES
Java insertion sort question
Java insertion sort question  I've got another program that I need help with. I am trying to write a Java method that accepts an array of strings, and sorts the strings using the insertion sort algorithm. Then I need to write
Insertion Sort Problem
Insertion Sort Problem  So I have this in a class file. It is supposed to be an insertion sorter: int min, index=0, temp; for(int i=0;i<sorted.length;i++){ min=sorted[i]; for(int j=i+1;j<
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
Insertion Sort - Java Beginners
Insertion Sort  Hello rose india java experts.If you don't mind.Can you help me.What is the code for Insertion Sort and Selection Sort that displays LETTERS in alphabetical order from A to Z. Thank you.Hope you gonna helpme
javascript variable value insertion in DB
javascript variable value insertion in DB  how can I insert javascript variable value into database using php
dynamic report
dynamic report  i need complete code for generating dynamic report in jsp

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.