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



Home Answers Viewqa JSP-Servlet dynamic multiplecheckbox values insertion

Have Programming Question? Ask it here!
 
 
 


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


hi

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

Advertisement
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 Tutorials/Questions & Answers:
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
Advertisements
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
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
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 Sort In Java
In this example we are going to sort integer values of an array using insertion sort... .Insertion sort is a good choice for small values and for nearly-sorted values... for large values . Positive feature of insertion sorting: 
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
insertion sort
insertion sort  how many arrays needed for insertion sort and why
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 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
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
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 applet code
insertion sort applet code  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
Insertion Sort Applet  Please All , I need Insertion sort applet program
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
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
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
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 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
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
data insertion and fetch 1
data insertion and fetch 1  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html>...,choice) VALUES('"+Id+"','"+Name+"','"+Home+"','"+Location+"','"+Gender
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
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
dynamic polymorphism
dynamic polymorphism  Develop with suitable hierarchy, classes for Point, Shape, Rectangle, Square, Circle, Ellipse, Triangle, Polygon, etc. Design a simple test application to demonstrate dynamic polymorphism
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
Inserting content(DOM Insertion)
Inserting content(DOM Insertion)       Inserting content(DOM Insertion) Inserting... : DOM insertion DOM insertion, Around DOM
Dynamic keyword
Dynamic keyword  hi....... What is the dynamic keyword used for in flex? give me the answer ASAP Thanks  Ans: Dynamic keyword-> Specifies that instances of a class may possess dynamic properties added
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
dynamic polymorphism
dynamic polymorphism  give an example for dynamic polymorphism?   Dynamic polymorphism is where a class overrides a superclass method... seen at runtime, so they are considered dynamic. Here is an example
dynamic textfields
dynamic textfields  Hi, I am a fresher and joined recently in one company. they gave me a desktop application project using swings.here is my detailed spec Screen 1 - The user enters the ingredients from a food product, saves
Dynamic form
Dynamic form  I need to make a dynamic form using jsp for example, i will need a list of items which when we select one option another list is modified ( like 2 lists of countries and citys ), and also a radio button wich once
dynamic jquery statement
dynamic jquery statement  dynamic jquery statement
dynamic form
dynamic form  I need to make a dynamic form using php, for example, i will need a list of items which when we select one option another list is modified ( like 2 lists of countries and citys from a dtabase ), and also a radio
dynamic calender
dynamic calender  hi i need the code to "insert date using GUI"   Hi Friend, Try the following code: import java.awt.*; import java.awt.event.*; import javax.swing.*; class DatePicker{ int month
Issue with tutorial realted to insertion in middle in Linked List
Issue with tutorial realted to insertion in middle in Linked List  insert in middle in Linked list will take O(N) instead as displayed as O(1
dynamic query
dynamic query  DECLARE QUERY VARCHAR2(32767); FIN_QUERY VARCHAR2(32767); CURSOR C IS (select distinct PORTFOLIO from MPE_TEST1); CURSOR C2 IS SELECT DISTINCT PORTFOLIO_LEVEL, PORTFOLIO FROM MPE_TEST1 ORDER
data insertion from xml file to database table
data insertion from xml file to database table  Hi all, I have data in the XML file. I need to insert it into table in the database using servlet. so please reply me . ThankYou
create dynamic array in javascript
create dynamic array in javascript  How to create dynamic array in javascript
php dynamic array checking
php dynamic array checking  php dynamic array checking
php dynamic array checking
php dynamic array checking  php dynamic array checking
PHP Dynamic CheckBox
PHP Dynamic CheckBox  Help with Dynamic Checkbox in PHP
 

 

 

DMCA.com