我有一個帶日期的文本框(用日期選擇器獲得),現在我試圖使用JavaScript獲取我的文本框的值。出於某種原因,我的函數返回null或者它只是errs.Can任何人都可以幫助我?javascript - 獲取包含日期的文本框的值?
<asp:TextBox ID="txtStartDate" name="txtStartDate" runat="server" MaxLength="100" CausesValidation="True"
ValidationGroup="PriorAuth" CssClass="effect"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="ceStartDate" runat="server" Format="MM/dd/yyyy"
PopupButtonID="ImageButton1" TargetControlID="txtStartDate" PopupPosition="BottomRight" />
alert("date: " + Date.parse(document.getElementsByName('txtStartDate').value));
var startDate = Date.parse(document.getElementsByName('txtStartDate').value);
它們都是未定義的 – user2140832