You need to sign in to do that
Don't have an account?

select all and deselect all checkbox
1) I have one VF page, I have used <apex:repeat with cehckbox.
ex:
<div class="accordion_head" onclick="javascript: if (isSpinner == 'false'){ isSpinner= 'true'; var child = j$(this).children(0);if (child.attr('class') == 'icon closed'){j$('#dialog-spinner').modal();designCatalog();}}"> Category <span class="icon closed"></span> </div> <div class="accordion_body closed"> <apex:outputPanel id="catPanel" > <apex:repeat value="{!ResultCatalog.categories}" var="category" id="thecategories"> <apex:outputPanel rendered="{!ResultCatalog.categories[category]}"> <label class="label_check c_on " for="{!category}" title="{!category}"> <input id="{!category}" type="checkbox" checked="true" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label> </apex:outputPanel> <apex:outputPanel rendered="{!NOT(ResultCatalog.categories[category])}"> <label class="label_check" for="{!category}" title="{!category}"> <input id="{!category}" type="checkbox" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label> </apex:outputPanel> </apex:repeat> </apex:outputPanel> </div>
2) I want to use a checkbox when i select checkbox all cehckboxes which is comes under <apex:repeat> tag should be get selected.
Please help me, I am new in salesforce technology.
ex:
<div class="accordion_head" onclick="javascript: if (isSpinner == 'false'){ isSpinner= 'true'; var child = j$(this).children(0);if (child.attr('class') == 'icon closed'){j$('#dialog-spinner').modal();designCatalog();}}"> Category <span class="icon closed"></span> </div> <div class="accordion_body closed"> <apex:outputPanel id="catPanel" > <apex:repeat value="{!ResultCatalog.categories}" var="category" id="thecategories"> <apex:outputPanel rendered="{!ResultCatalog.categories[category]}"> <label class="label_check c_on " for="{!category}" title="{!category}"> <input id="{!category}" type="checkbox" checked="true" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label> </apex:outputPanel> <apex:outputPanel rendered="{!NOT(ResultCatalog.categories[category])}"> <label class="label_check" for="{!category}" title="{!category}"> <input id="{!category}" type="checkbox" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label> </apex:outputPanel> </apex:repeat> </apex:outputPanel> </div>
2) I want to use a checkbox when i select checkbox all cehckboxes which is comes under <apex:repeat> tag should be get selected.
Please help me, I am new in salesforce technology.
function checkAll(cb){
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++){
if(inputElem[i].id.indexOf("checkedone")!=-1)
inputElem[i].checked = cb.checked;
}
}
onclick event i call the above script but it did not work
ex :
<apex:repeat value="{!ResultCatalog.categories}" var="category" id="thecategories"> <apex:outputPanel rendered="{!ResultCatalog.categories[category]}"> <label class="label_check c_on " for="{!category}" title="{!category}"> <input id="{!category}" type="checkbox" checked="true" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label> </apex:outputPanel> <apex:outputPanel rendered="{!NOT(ResultCatalog.categories[category])}"> <label class="label_check" for="{!category}" title="{!category}"> <input id="{!category}" type="checkbox" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label> </apex:outputPanel> </apex:repeat>
<apex:repeat value="{!ResultCatalog.categories}" var="category" id="thecategories">
<label class="label_check c_on " for="{!category}" title="{!category}"> <input id="{!category}" type="checkbox" checked="true" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label>
</apex:repeat>
<apex:repeat value="{!ResultCatalog.categories}" var="category" id="thecategories">
<label class="label_check c_on " for="{!category}" title="{!category}"> <input id="checkedone" type="checkbox" checked="true" onclick="javascript:doAddLimiter('Job_Category_Description__c','{!category}');" /> {!category} </label>
</apex:repeat>