Click here to Skip to main content
15,887,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using bootstrap date picker but its not working fine because when i select a particular year among a specific range then directly date in displayed in a text box month selecting is not appear
For Example If i want to select 31 Oct 1989 then i will select the year 1989 from
1980-1989 after selecting 1989 it doesn't allow me to select a month it directly display a date in a text box such as 1989-09-01

Here is my script for selecting date

XML
<script type="text/javascript">
        $(document).ready(function () {
            var dp = $('#<%=txt_birthdate.ClientID%>');
            dp.datepicker({
                changeMonth: true,
                changeYear: true,
                format: "yyyy-mm-dd",
                language: "tr"
            }).on('changeDate', function (ev) {
                $(this).blur();
                $(this).datepicker('hide');
            });
        });
    </script>


Here is my code for a Text Box

XML
<div class="form-group col-md-4" id="birthdate">
                                <label>
                                    Date Of Birth :
                                </label>
                                <asp:TextBox ID="txt_birthdate" runat="server" CssClass='form-control' ClientIDMode="Static"
                                    placeholder="Date Of Birth"></asp:TextBox>
                            </div>



Please help me to solve this problem
Posted

Sorry friends but i change my script and now its working fine me but anyways always a big thanks to you all for helping me
Here is script for future use

XML
<script type="text/javascript">
        $(document).ready(function () {
            var dp = $('#<%=txt_birthdate.ClientID%>');
            dp.datepicker({
                format: "yyyy-mm-dd",
            });
        });
    </script>
 
Share this answer
 
XML
<script type="text/javascript">
        $(document).ready(function () {
            var dp = $('#<%=txt_birthdate.ClientID%>');
            dp.datepicker({
                format: "yyyy-mm-dd",
            });
        });
    </script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900