Reputation: 125
I have a Basic Date picker and i would like to get 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.
Upvotes: 1
Views: 1511
Reputation: 82893
Use value
(note v should be lower case)
var toDate = document.getElementById('<%=bdpToDate.ClientID %>_TextBox').value;
Upvotes: 1