I am displaying 24 checkboxes. I want to get all the values of checked checkboxes in action class and insert it as a new record inside database.Inserting will be done once I succeed in getting the values of checked checkboxes on button click.
I referred this link in which I followed the answer answered by steven sir but with help of that I can display only boolean values but here I want text values of checkboxes selected.
So below is my JSP page.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<s:form action="eventInsertAction">
<!-- Main content -->
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<div class="contetpanel">
<div>
<div class="crevtbl">
<div class="crevtblRow">
<div class="crevtblCell">Event Name</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2"><input name="event.eventName" class="formtextfield" type="text"><s:fielderror fieldName="event.eventName"/></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">Company Name</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2"><input name="event.companyName" class="formtextfield" type="text" ><s:fielderror fieldName="event.companyName"/></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">Contact Person Name</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2"><input name="event.contactPerson" class="formtextfield" type="text" ><s:fielderror fieldName="event.contactPerson"/></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">Contact</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2"><input name="event.contactNumber" class="formtextfield" type="text" ><s:fielderror fieldName="event.contactNumber"/></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">Email</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2"><input name="event.emailId" class="formtextfield" type="text" ><s:fielderror fieldName="event.emailId"/></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">Event Venue</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2"><input name="event.eventVenue" class="formtextfield" type="text" ><s:fielderror fieldName="event.eventVenue"/></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">Event Date</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2">From : <input name="event.fromDate" class="formtextfield1" type="text" placeholder="YYYY/MM/DD"> To : <input name="event.toDate" class="formtextfield1" type="text" placeholder="YYYY/MM/DD"></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">Event Time</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2"><input name="event.eventTime" class="formtextfield1" type="text" placeholder="HH:MM AM/PM" ><s:fielderror fieldName="event.eventTime"/></div>
</div>
<div class="crevtblRow">
<div class="crevtblCell">License Required</div>
<div class="crevtblCell1">:</div>
<div class="crevtblCell2">
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Rangabhoomi</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Fire NOC</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Fire Engine</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Premises & NOC</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Performance</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">PWD</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Local Police</span><br />
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Collector</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">PPL</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">IPRS</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Traffic</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Liquor License</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Ticket Selling License</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">BMC Parking</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Parking</span><br />
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Port Trust</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Novex</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Foreign Artist</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">DCP Office</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Fire Marshal</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Sale Tax NOC</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Other</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Extra</span>
<input name="event.licenserequired" type="checkbox" class="formcheckbox" value=""><span class="formcheckbox_content">Commission</span>
</div>
</div>
<div class="c
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…