Jayce
Jayce

Reputation: 595

How include Jquery widget datepicker

I have a problem when I would like include a datepicker widget. I would like do like here : enter link description here. I download the zip but here : enter link description here

Here my html code :

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery-ui-1.10.4.custom"></script>
<script src="js/jquery-ui-1.10.4.custom.min"></script>
<script>
    $(function () {
        $("#from").datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 3,
            onClose: function (selectedDate) {
                $("#to").datepicker("option", "minDate", selectedDate);
            }
        });
        $("#to").datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 3,
            onClose: function (selectedDate) {
                $("#from").datepicker("option", "maxDate", selectedDate);
            }
        });
    });
</script>
</head>
<body>
<div><label for="from">From</label>
<input type="text" id="from" name="from"/>
<label for="to">to</label>
<input type="text" id="to" name="to"/>
   </div> 
<br />
<table id="table_campaigns" class="display">
    <caption style="font-size:20px">Statistiek 6</caption>
<thead>
</thead>
<tbody>
</tbody>
</table>
<br />
<br />

<table id="table1" class="display">
<thead>
</thead>
<tbody>
</tbody>
</table>
</body>
</html>

I have this : SyntaxError: syntax error

Did I download the right zip? What's wrong?

Upvotes: 0

Views: 648

Answers (2)

Kalzem
Kalzem

Reputation: 7501

From http://api.jqueryui.com/1.8/datepicker/

Additional Notes:

This widget requires some functional CSS, otherwise it won't work. 
If you build a custom theme, use the widget's specific CSS file as a starting point. 

You should include jquery-ui.css

Upvotes: 1

Legionar
Legionar

Reputation: 7607

<script src="js/jquery-ui-1.10.4.custom"></script>
<script src="js/jquery-ui-1.10.4.custom.min"></script>

Dont use both, just one of them...

And also you have wrong file name, you are missing .js

Upvotes: 2

Related Questions