\[code\]// text Box <asp:TextBox ID="TextBox3" runat="server" BackColor="Silver" BorderColor="Silver" ontextchanged="TextBox3_TextChanged" style="margin-left: 6px" Width="154px"></asp:TextBox>// Submit button <asp:Button ID="Button6" runat="server" BackColor="Silver" onClientclick='store_memID()' style="margin-left: 20px" Text="Submit" Width="102px" Font-Bold="True" Height="28px" /> <script type = "text/javascript"> // 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); } </script>\[/code\]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".
Else, if I remove the '.value' :-\[code\]<script type = "text/javascript"> // Function to caputure client-input- Member_ID. function store_memID() { var mem_ID = document.getElementById('TextBox3'); return confirm('TimeLine is displayed for: ' + mem_ID); }</script>\[/code\]and then run the program, enter value in text box and press submit then i get :-"TimeLine is displayed for: Null"I have been looking into solving this problem. not sure whats going wrong... 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:- '<%=TextBox3.ClientID%>'
Else, if I remove the '.value' :-\[code\]<script type = "text/javascript"> // Function to caputure client-input- Member_ID. function store_memID() { var mem_ID = document.getElementById('TextBox3'); return confirm('TimeLine is displayed for: ' + mem_ID); }</script>\[/code\]and then run the program, enter value in text box and press submit then i get :-"TimeLine is displayed for: Null"I have been looking into solving this problem. not sure whats going wrong... 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:- '<%=TextBox3.ClientID%>'