Another Salesforce blog!!!

Salesforce, Apex

Check to see what checkbox is checked (looping)


//flag for to check weather any option is selected or not. Default to all selected.
        var flag = false;
        //Retrieves controls for which the drop down selected option is set.
        var dropDownControls = $(‘#<%=gv.ClientID %> select option:selected’);
        var checkboxes = $(“.selectreject input[type=’checkbox’]”);
        for (index = 0; index < checkboxes.length; index++) {
            if (checkboxes[index].checked) {
                if (dropDownControls[index].innerText == “Select Reason”) {
                    args.IsValid = false;

Leave a Reply

Your email address will not be published. Required fields are marked *