title: javascript - get value of a text box that contains a date?
body: <p>I have a text box with a date (gotten with a date picker) and now I am trying to get the value of my text box using JavaScript. For some reason my function is returning null or it just errs.Can anyone help me?</p>
  
  <pre><code>&lt;asp:TextBox ID="txtStartDate" name="txtStartDate" runat="server" MaxLength="100"   CausesValidation="True"
                                                                       ValidationGroup="PriorAuth" CssClass="effect"&gt;&lt;/asp:TextBox&gt;
  
  &lt;ajaxToolkit:CalendarExtender ID="ceStartDate" runat="server" Format="MM/dd/yyyy"
                                                                      PopupButtonID="ImageButton1" TargetControlID="txtStartDate" PopupPosition="BottomRight" /&gt;
  
   alert("date: " + Date.parse(document.getElementsByName('txtStartDate').value));
                  var startDate = Date.parse(document.getElementsByName('txtStartDate').value);
  </code></pre>