-1

I am using spring's tag in my html. My jsp has a group of checkbox which renders value from model object "allTimeslots". This object has list of string.

    form:checkboxes element="li" path="timeslotId" id="checkbox" type="checkbox"
                                            items="${allTimeslots}" /></td></tr></table>

Now, my requirement is to check if atleast one check-box is checked when the form is submitted. I am using jquery validation where this check has to be done. I cannot use type="checkbox" as this is not permitted in spring's tag. Please suggest.

romil gaurav
  • 1,121
  • 11
  • 23
  • 43

1 Answers1

0
    <form:checkboxes element="li" path="timeslotId"
    items="${allTimeslots}" />

and in javascript

$('input[name="timeslotId"]:checked').length > 0 

will do the work.

romil gaurav
  • 1,121
  • 11
  • 23
  • 43