You need to sign in to do that
Don't have an account?
bev90210
Very simple JS question
Hi there,
I am trying to make a field read-only and would like to do this in the javascript of the page when it loads. I try using the intructions in the VF developer guide with no luck, anyone have an idea? Thanks in advance.
Code:
<script> function atload() { //This line does NOT work //var ba = document.getElementById('{!$component.sprinknum}'); //This line works, but not very elegant syntax var ba = document.getElementById("j_id0:j_id3:thePageBlock:j_id53:sprinknum"); ba.readOnly = true; } window.onload=atload; </script> <*****Valid Visualforce/apex code here> <apex:inputField id="sprinknum" value="{!Sprinkles__c.Sprinkles_Number__c}"/> <*****Valid Visualforce/apex code here>
:smileyhappy: