Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

Getting Check box values using array in JSP

Getting Check box values using array in JSP

 
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans
View previous topic :: View next topic  
Author Message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Sat Dec 06, 2008 12:41 pm    Post subject: Getting Check box values using array in JSP Reply with quote

Hi
We have to display a list of records which user can select any number of records and do action on it by selecting checkbox in jsp.
I have one unique id associated with each record and displaying at fetching records and will be used as value of the check box.

How to get checkbox values in array and for next action
Back to top
View user's profile Send private message
hotjava



Joined: 25 Mar 2007
Posts: 14

PostPosted: Wed Dec 24, 2008 5:43 am    Post subject: Reply with quote

Getting checkbox value in array by request object

Code:
<input type="checkbox" name="checkboxName" value="a" />
<input type="checkbox" name="checkboxName" value="b" />
<input type="checkbox" name="checkboxName" value="c" />
<input type="checkbox" name="checkboxName" value="d" />


Code:
String[] variable=request.getParameterValues("checkboxName");


This string variable now have
{"a","b","c","d"}

by any loop you can get all these values in jsp
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack