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 12
HuaMin ChenProblem resolverAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

https://jsfiddle.net/JSFiddler1/pnjhL2jj/
0
HuaMin ChenProblem resolverAuthor 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
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Dorababu MSenior Software EngineerCommented:
Why in css file? it should be in Javascript or on your page
0
HuaMin ChenProblem resolverAuthor 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
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.