I am creating a table in JSP which contains records which are dynamically displayed and which also contains Checkbox.
I am updating the database depending upon the selection of the checkboxes.
The functionality is working fine but I am unable to throw a validation message in case the user does not select any of the checkboxes.
alert("please select checkbox");
<form name=myForm action=Acc.jsp>
<input type =checkbox name=check>
<input type =checkbox name=check id=val>
now if u have multiple checkboxes u need to generate ids as
val1, val2, val3 ....
so also u have to write a loop around the if(to check for val1,val2,val3...). then if condition is not satisfied keep a flag. and check the flag after the loop and display the error.
hope this helps.
I think ur code is right, but u have used single = (ASSIGNMENT) instead of == (EQUALITY) that might be the problrm..