Link to home
Start Free TrialLog in
Avatar of Galagos1
Galagos1

asked on

asp.net 4 to javascript

How do you read in a value from a asp.net text box in javascript.  I am not using a form.
var dateValue = new Date();
dateValue = this.document.getElementById("txtDate1").value;
reading it from this text box.
<asp:TextBox
     ID="txtDate1"
     runat="server"/>
I get this error when I run it
Microsoft JScript runtime error: Object required
ASKER CERTIFIED SOLUTION
Avatar of Rahul Agarwal
Rahul Agarwal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think, agarwalrahul meant to use

dateValue = document.getElementById('<%=txtDate1.ClientID%>').value