Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery-UI Datepicker CSS problem

I've got this pretty simple HTML page with a jQuery datepicker:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>jQuery Datepicker</title>
    <link rel="stylesheet" href="../App_Themes/Default/ui.datepicker.css" type="text/css"
        media="screen" title="Smoothness" />

    <script src="../Shared/Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>

    <script src="../Shared/Scripts/jquery-ui-1.5.3.min.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
        $(document).ready(PageLoad);

        function PageLoad() {
            $('#textBox').datepicker();
        }
    </script>

</head>
<body>
    <input type="text" id="textBox" />
</body>
</html>

The datepicker itself seems to work perfectly but I can't apply my theme. Am I missing something really stupid here?

Thanks !!!!

like image 640
Andre Gallo Avatar asked Dec 03 '22 08:12

Andre Gallo


1 Answers

If you load jQueryUI through Google, make sure the jQueryUI CSS theme has the same version as the jQueryUI library.

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>

<script src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js' type='text/javascript'></script>

Check the above code, both use 1.8.5. But if you load 1.8 instead of 1.8.5 for the theme the datapicker won't show up.

like image 108
bart Avatar answered Dec 16 '22 12:12

bart