Problem to datepicker

Hi,
I cannot show datepicker, using the below codes. Why?

            $("#tb_birth").datepicker({
                dateFormat: "yy-mm-dd",
                changeYear: true,
                showOn: "button",
            }).next('button').text('').button({
                icons: {
                    primary: 'ui-icon-calendar'
                },
                label: "Select a date",
                text: false
            })
            ...
                <asp:TextBox ID="tb_birth"
                    width="310px"
                    Enabled="false"
                    class="Datepicker"
                    Font-Names="標楷體" 
                    Font-Size="13pt" 
                    Font-Bold="true"
                    ForeColor="Black"
                    runat="server" />

Open in new window

LVL 11
HuaMin ChenSystem AnalystAsked:
Who is Participating?
 
Ryan ChongConnect With a Mentor Commented:
try change:
<script type="text/javascript" src="JavaScript1.js">

Open in new window

to:
<script type="text/javascript" src="JavaScript1.js"></script>

Open in new window


and then in JavaScript1.js, try encapsulate your scripts into a function, like:
$(function () {
    $("#tb_birth").datepicker({
        dateFormat: "yy-mm-dd",
        changeYear: true,
        showOn: "button",
    }).next('button').text('').button({
        icons: {
            primary: 'ui-icon-calendar'
        },
        label: "Select a date",
        text: false
    });
});

Open in new window

0
 
Dorababu MSenior Software EngineerCommented:
Check here and see what you are missing

https://jsfiddle.net/JSFiddler1/pnjhL2jj/
0
 
HuaMin ChenSystem AnalystAuthor Commented:
Can you please see 5th Textbox below, and advise why I cannot show the datepicker, while codes are existing within file - StyleSheet1.css

http://my-friend.co/UserMaintenance2/Default.aspx?userid=mc4&readonly=n
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Dorababu MSenior Software EngineerCommented:
I am not seeing  this code in your page
 $("#tb_birth").datepicker({
                dateFormat: "yy-mm-dd",
                changeYear: true,
                showOn: "button",
            }).next('button').text('').button({
                icons: {
                    primary: 'ui-icon-calendar'
                },
                label: "Select a date",
                text: false
            })

Open in new window

0
 
Dorababu MSenior Software EngineerCommented:
Why in css file? it should be in Javascript or on your page
0
 
HuaMin ChenSystem AnalystAuthor Commented:
Hi,
I've put the codes to JavaScript1.js, but the problem persists that I cannot see the datepicker (to the field), after re-deployment.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.