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

Toggle the checkbox
Hi All,
I am new to slesforce. i have created a stadard object and creating the Visual force page for he same. I have 2 checkboxes., on clicking the first one, second should become disable/Hide.
i m using the change jquery event when first check box is selected nd trying to toggle the second checkbox. But my change event is not getting called.
I m not ble to find the exact reson. Please hve a look on the code.
<apex:page standardController="Batch__c" >
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){
alert('testfirst');
$("#studentnoptification").change(function(){ ===> control not reaching here
alert('test');
$("#isprof").toggle();
});
});
</script>
<apex:form >
<apex:pageBlock>
<apex:pageBlockSection id="pbSection1" columns="1">
<apex:inputfield value="{!Batch__c.Name}" id="Bus" required="true"/>
<apex:inputfield value="{!Batch__c.isstudent__c}" id="studentnoptification"/>
<apex:inputfield value="{!Batch__c.Lab_Timing__c}" required="true"/>
<apex:inputfield value="{!Batch__c.isproffessional__c}" id="isprof"/>
</apex:pageBlockSection>
<apex:pageBlockButtons > <apex:commandbutton value="Save" action="{!save}"></apex:commandbutton> <apex:commandbutton value="Save & new" action="{!quicksave}"></apex:commandbutton> <apex:commandbutton value="Cancel" action="{!cancel}"></apex:commandbutton>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks in Advance
I am new to slesforce. i have created a stadard object and creating the Visual force page for he same. I have 2 checkboxes., on clicking the first one, second should become disable/Hide.
i m using the change jquery event when first check box is selected nd trying to toggle the second checkbox. But my change event is not getting called.
I m not ble to find the exact reson. Please hve a look on the code.
<apex:page standardController="Batch__c" >
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){
alert('testfirst');
$("#studentnoptification").change(function(){ ===> control not reaching here
alert('test');
$("#isprof").toggle();
});
});
</script>
<apex:form >
<apex:pageBlock>
<apex:pageBlockSection id="pbSection1" columns="1">
<apex:inputfield value="{!Batch__c.Name}" id="Bus" required="true"/>
<apex:inputfield value="{!Batch__c.isstudent__c}" id="studentnoptification"/>
<apex:inputfield value="{!Batch__c.Lab_Timing__c}" required="true"/>
<apex:inputfield value="{!Batch__c.isproffessional__c}" id="isprof"/>
</apex:pageBlockSection>
<apex:pageBlockButtons > <apex:commandbutton value="Save" action="{!save}"></apex:commandbutton> <apex:commandbutton value="Save & new" action="{!quicksave}"></apex:commandbutton> <apex:commandbutton value="Cancel" action="{!cancel}"></apex:commandbutton>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks in Advance
change $("#studentnoptification").change(function(){})
to
$('[id$="studentnoptification"]').change(function(){})