trying to loop through hidden fields and then change display accordingly. style.display error
<p>Another newbie question from me.</p>

<p>Just checking whether my code below is possible. I.e creating a new array consisting of 'document.GetElementById's'. As i'm fairly new to javascript my code is generally a bit long winded, so please forgive the messiness.</p>

<p>The code below is bringing up the error 'style.display' is 'null' or not an object.
Can anyone see anything obvious i'm missing or doing wrong?</p>

<pre><code>function Test(){

if(document.getElementById('inClient').value !=="FormViewer"){

    var visible =new Array("document.getElementById('personal2').value","document.getElementById('change_hours2').value");
    var change = new Array("document.getElementById('personal').value","document.getElementById('change_hours').value");

    for (var i=0; i &lt;visible.length; i++) {
        if(visible[i]!==""){
            change[i].style.display = "block"
         }
      }
   }
}
</code></pre>

<p>Basically if the hidden fields ('personal2' etc) are blank i want the div / section ('personal' etc) to remain hidden but if it contains text then i want to show the section.</p>

<p>Thanks in advance</p>
