Extracting user entry from text box and storing it in a variable in javascript
<pre><code>// text Box
        &amp;nbsp;&amp;nbsp;&lt;asp:TextBox ID="TextBox3"  runat="server" BackColor="Silver" 
            BorderColor="Silver" ontextchanged="TextBox3_TextChanged" 
            style="margin-left: 6px" Width="154px"&gt;&lt;/asp:TextBox&gt;

// Submit button
        &amp;nbsp;&lt;asp:Button ID="Button6" runat="server" BackColor="Silver" 
            onClientclick='store_memID()' style="margin-left: 20px" Text="Submit" 
            Width="102px" Font-Bold="True" Height="28px" /&gt;


    &lt;script type = "text/javascript"&gt;
        // Function to caputure client-input- Member_ID.
        function store_memID() {

            var mem_ID = document.getElementById('TextBox3').value;


            return confirm('TimeLine is displayed for: ' + mem_ID);
        }

    &lt;/script&gt;
</code></pre>

<p>When I run the code and enter a value into the text box and then press the submit button:-
"Microsoft JScript runtime error: Unable to get value of the property 'value': object is null or undefined".</p>

<p><br><br>
Else, if I remove the '.value' :-</p>

<pre><code>&lt;script type = "text/javascript"&gt;
    // Function to caputure client-input- Member_ID.
    function store_memID() {

        var mem_ID = document.getElementById('TextBox3');


        return confirm('TimeLine is displayed for: ' + mem_ID);
    }

&lt;/script&gt;
</code></pre>

<p>and then run the program, enter value in text box and press submit then i get :-</p>

<p>"TimeLine is displayed for: Null"</p>

<p>I have been looking into solving this problem. not sure whats going wrong... </p>

<p><em><strong>Edit (fix):- Server Side ID for my text box is 'TextBox3' but this doesn't necessarily match up with the client side ID. 
to get Client Side ID:- '&lt;%=TextBox3.ClientID%>'</em></strong>    </p>
