如何在Spring表单中使用jQuery选择所有复选框 [英] How to select all check boxes using jquery in spring form

查看:69
本文介绍了如何在Spring表单中使用jQuery选择所有复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是春季形式,如何使用jquery选中所有复选框?

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>

推荐答案

为所有复选框提供通用类,然后尝试执行此操作...

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

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

这篇关于如何在Spring表单中使用jQuery选择所有复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆