In Javascript, Value not comming instead the variable name is displayed
<pre><code>function ProvideValue(){

    Values = document.getElementById('HiddenValue').value;

FirstCut = Values.split("@#@"); // This will return the array ID@-@VALUE@-@TYPE

    var CtrlId;
    for (i = 0; i &lt; FirstCut.length - 1; i++) {

        Strings = FirstCut[i];
        SecondCut = Strings.split("@-@");

        if(SecondCut[2].match("TEXT")) {
            CtrlId = "" + SecondCut[0];
            document.getElementById(CtrlId).value = SecondCut[1];
        }
    }
}
</code></pre>

<p>This is my code instead of the Id, which i can print it.But CtrlId is not replaced by the actual value. Am getting error  <code>document.getElementById(CtrlId).value is NULL</code>. I tried to hard code the ID then its working fine but i cannot hard code the controlsID because there are 1000s of control and everytime the ID changes.</p>
