You need to sign in to do that
Don't have an account?
maheshep.ax379
JavaScript Problem
<script>
function chkDeleteFn(objCbMaster)
{
alert(document.getElementById(objCbMaster).checked);
}
</script>
<apex:pageBlockTable value="{!contacts}" var="contact" styleClass="tableClass">
<apex:column>
<apex:facet name="header">
<apex:inputCheckbox id="idMasterCheck" />
</apex:facet>
<apex:inputCheckbox id="idCheck" value="{!contact.selectContact__c}" onclick="chkDeleteFn('{!$Component.idMasterCheck}');"/>
</apex:column>
</apex:pageBlockTable>
The javascript only triggers only for the first row of the table generated.
can anyone help me??? thanks in advance...
function chkDeleteFn(objCbMaster)
{
alert(document.getElementById(objCbMaster).checked);
}
</script>
<apex:pageBlockTable value="{!contacts}" var="contact" styleClass="tableClass">
<apex:column>
<apex:facet name="header">
<apex:inputCheckbox id="idMasterCheck" />
</apex:facet>
<apex:inputCheckbox id="idCheck" value="{!contact.selectContact__c}" onclick="chkDeleteFn('{!$Component.idMasterCheck}');"/>
</apex:column>
</apex:pageBlockTable>
The javascript only triggers only for the first row of the table generated.
can anyone help me??? thanks in advance...
:0:idMasterCheck
:1:idMasterCheck
etc.
Since idMasterCheck is in a facet, there's only one of them so it can't find :1:idMasterCheck etc. If you do alert(objCbMaster); in your javascript function, then copy the id from the alert box you can paste it in the parameters for the onclick event. That should fix the problem.
Message Edited by XactiumBen on 07-22-2008 06:42 AM