Get the value of a BasicDatePicker with JavaScript
I have a Basic Date picker and i would like to ge开发者_JS百科t its value in a JavaScript method. No matter what i try it says undefined is the value. Here is my code that i am using.
<BDP:BasicDatePicker runat="server" ID="bdpToDate" TextBoxStyle-Width="62px" DateFormat="dd-MM-yyyy">
</BDP:BasicDatePicker>
and in the javascript method.....
var toDate = document.getElementById('<%=bdpToDate.ClientID %>').selectedDate;// does not work
also i have tried using .selectedText and .Value behind the getElementById method and neither worked.
Use value
(note v should be lower case)
var toDate = document.getElementById('<%=bdpToDate.ClientID %>_TextBox').value;
精彩评论