You need to sign in to do that
Don't have an account?
Gayathri Adoni04
Checkbox Example Using Javascript in visualforcepage
Hi All,
I am first time using javascript and i am new to salesforce too.So please help me to know where i am going wrong.
My Requirement is Onclick of checkbox a textfield should appear that too using only javascript not the controller class.I will be sharing my code here.Please helpme out with solutions.If you have some examples of javascript vfpage please do share it.It would be very beneficial to learn the things.Thanks in advance.
I am first time using javascript and i am new to salesforce too.So please help me to know where i am going wrong.
My Requirement is Onclick of checkbox a textfield should appear that too using only javascript not the controller class.I will be sharing my code here.Please helpme out with solutions.If you have some examples of javascript vfpage please do share it.It would be very beneficial to learn the things.Thanks in advance.
<apex:page standardController="contact" > <apex:form > <apex:pageBlock title="Javascript Example"> <apex:pageBlockSection title="Checkbox Example"> <apex:inputCheckbox id="cc" value="{!contact.Check_Me__c}" label="Do not call" onclick="tt(this,'{!$Component.ii}'})"/> <apex:inputField id="ii" value="{!contact.Languages__c}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> <script> function tt(input,txt) { if(input.checked) document.getElementById(txt).checked=true; else document.getElementById(txt).checked=false; } </script> </apex:page>
All Answers
Thanks
Shashikant
Shashikant Sharma