About this question
I am trying to get the value of a text field in a VF page in JavaScript. Below is my VF page and getting the error “cannot read property of null”.
[removed] function initialize(){ alert('called' + document.getElementById("thePage:theform:atextId").value); } [removed] When I click the link I get this error in the inspect window. Cannot read property 'value' of null I might be missing something here. I checked the path of the text field using inspect window and I saw: <input id="thepage:theform:atextId" maxlength="8" name="thepage:theform:atextId" size="20" type="text" value="731645"> What am I missing here. How to resolve this,why do I get a null?