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



Home Answers Viewqa Struts Retriving multiple values of checkboxes in struts
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Chetan Shinde
Retriving multiple values of checkboxes in struts
1 Answer(s)      3 years and 7 months ago
Posted in : Struts


how to retrive multiple values of checkboxes of jsp in action class


Advertisement
View Answers

February 14, 2011 at 4:44 PM


JSP Retrieve checkbox values

1)checkbox.jsp:

<html>
<body>
<form method="post" action="../Action" >
Select Languages:<br>
<input type="checkbox" name="lang" value="C/C++">C/C++<br>
<input type="checkbox" name="lang" value="JAVA">Java<br>
<input type="checkbox" name="lang" value="C#">C#<br>
<input type="checkbox" name="lang" value="PERL">PERL<br>
<input type="checkbox" name="lang" value="PYTHON">PYTHON<br>
<input type="submit" value="Submit">
</form>
</body>
</html>

2)In Action class, use the following code:

if(request.getParameter("lang")!=null){
String st[]=request.getParameterValues("lang");
out.println("You have selected:");
for(int i=0;i<st.length;i++){
    out.println(st[i]);
}
}


Related Tutorials/Questions & Answers:
Retriving multiple values of checkboxes in struts
Retriving multiple values of checkboxes in struts  how to retrive multiple values of checkboxes of jsp in action class   JSP Retrieve checkbox values 1)checkbox.jsp: <html> <body> <form method="post
Updating multiple value depending on checkboxes
Updating multiple value depending on checkboxes  Hi .. I want to Update the multiple values of database using checkboxes and want to set the session for selected checkboxes..? please answer if any one knows as soon as possible
Advertisements
Array of checkboxes - Struts
Array of checkboxes  How to handle unknown number of checkboxes using tag in an ActionForm.   Hi friend, Code for multiple checkbox...://www.roseindia.net/struts/ Thanks
Not retriving the validations from validation.xml - Struts
Not retriving the validations from validation.xml  I have create the file called register.jsp    LoginID: Password: when i
retaining the selected values in html:select multiple="true" in jsp + collection + struts
retaining the selected values in html:select multiple="true" in jsp + collection + struts  Hi, I have a multiple selection box in one of the jsp...;strong> <html:select multiple="true" style="width
multiple select values
multiple select values   can you provide an example for multiple select values for html:select tag
how to store multiple values from drop down in database where i am using java struts 1.3
how to store multiple values from drop down in database where i am using java struts 1.3  hii, i am coding a form where i need a keyskills attribute... is displaying.. i need code in java so that it takes multiple values
select tag multiple values
select tag multiple values   I want to insert multiple values in database which i have selected from select tag
multiple selections list in Struts
multiple selections list in Struts  How to create a multiple selections list in Struts? and retrive seleted values
how to update combobx's selected value to database with respect toselected multiple checkboxes
how to update combobx's selected value to database with respect toselected multiple checkboxes   suppose this if form1.jsp in which i am going... values which is selected from form1.jsp String languages=""; String box
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
want to ask how to update data for runtime selected multiple checkboxes
want to ask how to update data for runtime selected multiple checkboxes ... have checkboxes for each record when I will select more than one checkboxex and entered the values in the textbox then it should get update in the database.I
retrieve multiple attribute values
XML retrieve multiple attribute values  Hello All Am a beginner. Would like some help with this. The following is part of my XML file: <...; What I would like is to retrieve both the attribute values of process
retrieve multiple attribute values
retrieve multiple attribute values  Hello All Am a beginner. Would like some help with this. The following is part of my XML file: <process... like is to retrieve both the attribute values of process:Output during execution
retrieve multiple attribute values
retrieve multiple attribute values  Hello All Am a beginner. Would like some help with this. The following is part of my XML file: <process... like is to retrieve both the attribute values of process:Output during execution
Multiple values for a single parameter
Multiple values for a single parameter   ... multiples values for a single parameter like in checkboxes. We are going to make one... from where the values will be passed to the controller. In this program we have
Regarding method returns multiple values
Regarding method returns multiple values  Hi, 1)I have a requirement like,1 method returns multiple values.how to do that one. 2)can i use method, for example like getFile()[] in this way or not. plzzzzzzzzzzzzzzzzzz provide
multiple configurstion file in struts - Struts
multiple configurstion file in struts  Hi, Please tell me the solution. I have three configuration file as 'struts-config.xml','struts-module.xml' and 'struts-comp.xml'.I have three jsp pages as 'index1.jsp','index2.jsp
Multiple file upload - Struts
Multiple file upload  HI all, I m trying to upload multiple files using struts and jsp. I m using enctype="multipart". and the number of files... only with servlets and i m using struts. I have this implemeted in servlets
How to insert multiple checkboxes into Msaccess database J2EE using prepared statement - Java Beginners
How to insert multiple checkboxes into Msaccess database J2EE using prepared..., StrRemarks) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; ps... for different subjects, you can insert the multiple subjects in one column
How to pass multiple values from a servlet to JSP?
How to pass multiple values from a servlet to JSP?  hi, I want to pass multiple values form a servlet to JSP. Hw do i do that? I am able to send one value at a time without any prb, but I am unable to carry multiple (from two
I want to update the multiple values of database depending on checkbox..? Please help me out..
I want to update the multiple values of database depending on checkbox..? Please help me out..   Hi .. I want to Update the multiple values of database using checkboxes and want to set the session for selected checkboxes
How to carry multiple values from a Servlet to a JSP?
How to carry multiple values from a Servlet to a JSP?  By using the below code I am able to carry the username to a JSP (single value). ----response.sendRedirect("index.jsp?uname="+username);---- But I want multiple values
@SessionAttributes multiple values
@SessionAttributes multiple values In this section we will see how you can use @sessionattributes to set multiple session values to it. While developing... and someCombobox. The correct way to use @sessionattributes for multiple values
retrieve multiple columns values from multiple csv files in java
retrieve multiple columns values from multiple csv files in java  Suppose there is folder in C:\fileupload which contains these two csv files: file1.csv has 3 columns(VendorID,Name) file2.csv has 2 columns(VendorID,address
i am getting multiple values in listbox
i am getting multiple values in listbox   hi sir, i am using... table group by stuname) order by a.name in a subquery multiple recdates i am getting its working fine, but in main query also i am getting multiple name
Multiple buttons in struts using java script
Multiple buttons in struts using java script  Multiple buttons in struts using java script
Java Method Return Multiple Values
Java Method Return Multiple Values In this section we will learn about how a method can return multiple values in Java. This example explains you how a multiple values can be return by a method. This example explains you all
Is Multiple Actions in Action class - Struts
Is Multiple Actions in Action class  In ActionClass we can use only one action i.e execute(), but in DispatchAction we can use multiple actions.My question is , we can use multiple actions in Action class if(action.equals("add
 

 

 

DMCA.com