elle
elle

Reputation: 3245

How to select all check boxes using jquery in spring form

This is the spring form, how to select all the checkboxes using jquery?

<form:form name="form" method="POST" commandName="da"> 
<table cellspacing="7">
    <tr>
        <td>Increment DA by:</td>
        <td><form:input path="da" id="da"/></td>
    </tr>
    <tr>
        <td>
        <form:checkboxes items="${empids}" path="empids" delimiter="<br/>" id="empids"/>
        </td>

    </tr>
    <tr>
        <td colspan="2"><input type="submit" value="Save" ></td>    
    </tr>
</table>
</form:form>

Upvotes: 0

Views: 2203

Answers (1)

Vivek
Vivek

Reputation: 11028

give a common class to all checkboxes and then try this...

$('.commonClass').attr('checked',true);

Upvotes: 2

Related Questions