Activity Forums Salesforce® Discussions How to select all checkboxes of wrapper list on vf page using jquery?

  • Sourabh

    April 12, 2016 at 7:53 am

    Hi Utsav,

    It seems to be working fine for me. Can you please explain exactly what problem you are facing?

  • Utsav

    April 12, 2016 at 2:23 pm

    Hi ,

    Yes it should work , but when i click on the select all checkbox then it shows an error in browser console that "missing attr".

    But now i think,  i have find out the issue . it actually comes due to the version of jquery i am including. Instead of using "attr" i should use "prop" so now my code will be:


    function checkAll(ele){
    var checkboxes = $(‘.SelectAll’);
    if (ele.checked) {
    $(‘.checkedone’).prop(“checked”, true);
    $(‘.checkedone’).prop(“checked”, false);

  • Sourabh

    April 13, 2016 at 4:11 am

    Console shows "missing attr" only if you have not included jquery.  The .prop() method gets the property value for only the first element in the matched set. You can use .prop() as a replacement of .attr() in your case.

  • Gourav

    June 20, 2016 at 1:53 pm

    Try to use this script in you VF page to select all check-box.

    <script type="text/javascript">
    function selectAllCheckboxes(obj,receivedInputID){
    var inputCheckBox = document.getElementsByTagName("input");
    for(var i=0; i<inputCheckBox.length; i++){
    inputCheckBox[i].checked = obj.checked;

Log In to reply.

Popular Salesforce Blogs