Neshkowsky
Neshkowsky

Reputation: 11

Simple ui datepicker do not works

I have problems with this datepicker http://jqueryui.com/demos/datepicker/

<script>
    $(function() {
        $( "#datepicker1" ).datepicker({ dateFormat: 'yy-mm-dd' });
    });
</script>
<script>
    $(function() {
        $( "#datepicker2" ).datepicker({ dateFormat: 'yy-mm-dd' });
    });
</script>

<div id="checkinWrapper" class="input-wrapper">
    <input type="text" id="datepicker1" style="width:118px;" class="checkin search-option hasDatepicker" name="checkin" placeholder="Поаѓаме на">
    <span></span>
</div>
<div id="checkoutWrapper" class="input-wrapper">
    <input type="text" id="datepicker2" style="width:118px; margin-left:2px;" class="checkout search-option hasDatepicker" name="checkout" placeholder="Се враќаме">
    <span></span>
</div>

When I test it on a blank page it works okay but when I implement it in my current design it don't works (do not show). I don't know what causes that. Here are the scripts that I include:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>

Maybe the problem occurs becouse I have other jQuery scripts implemented in my current design ? Any solution ?

Upvotes: 0

Views: 603

Answers (1)

James Kyburz
James Kyburz

Reputation: 14503

If you remove the hasDatepicker class from both input tags it will work.

The datepicker plugin adds this class itself, as the class already exists no datepicker is created...

See http://jsfiddle.net/UYGXh/ for a working (non styled) example

Upvotes: 2

Related Questions