Thursday 3 May 2012

Inline scripting in Vf pages

If you want to get id of any element and set certain property to it you can do that by inline scripting. Below is the code snippet which is getting inputtext id and set the disabled property to it.
 <apex:inputText id="testid" style="width:40pt;text-align:center;" styleClass="testclass"></apex:inputText>  
 <script>document.getElementById('{!$Component.testid}').disabled = true; </script>  

No comments:

Post a Comment