Hi ,
I have a JSP page where i have few checkboxes and i have disabled few of them usign javascript for certain conditions.
When i fetch the value from checkbox using request.getParameterValues("CheckBoxName");
, then do i get the values from disabled checkboxes too or disabled checkboxes are not considered by java when we fetch value?
Here is the code , checkbox with id s1 and s2 are dibaled using javascript
<form action="booking_cnf" method="post">
<!-- checkbox id is same as the value of SeatNo in the database -->
<!-- checkbox with id=1 and id=2 are disabled using javascript -->
<input type="checkbox" id="s1" name="seat" value="s1">
<input type="checkbox" id="s2" name="seat" value="s2">
<input type="checkbox" id="s3" name="seat" value="s3">
<input type="checkbox" id="s4" name="seat" value="s4">
<input type="hidden" name="doj" value="<%=doj%>">
<input type="hidden" name="BusNo" value="<%=BusNo%>">
<input type="submit" value="book">
</form>
Now the action class or model has the followind code
String BookSeats[] = request.getParameterValues("seat");
if(BookSeats !=null){
for(int i=0; i<BookSeats.length; i++){
System.out.println(BookSeats[i]);
//here i will insert the seats in database which are selected in checkboxes
}
}
Can i do this ?
I am confused , what happends with the disabled checkboxes?
Please Help