views:

73

answers:

4

Hey, any ideas why this wont work, when i click on the input fields, nothing happens. Here is the code:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript" charset="utf-8">
            $(function()
            {
                $('.date-pick').datePicker();
            });
        </script>

This my form:

<form id="form1" name="form1" method="post" action="chart.php">
    <ul id="add_form">
            <li><label>Date from</label>
             <input type="text" name="date1"  class="date-pick" /></li>
            <li><label>Date to</label>
             <input type="text" name="date2"  class="date-pick" value="<?php echo date("Y-m-d") ?>" /></li>
            <li><label>Display</label>
            <select name="type">
              <option value="1">User Joins</option>
              <option value="2">Messages sent</option>
              <option value="3">Optin/outs</option>
            </select>
            </li>
            </ul>
            <br clear="all" /><br />
           <input type="image" src="images/show.jpg" border="0" alt="Submit Form" class="login" />
    </form>
A: 

I think you want a lowercase p.

$('.date-pick').datepicker();
Tmdean
That didnt work :S
Are you using the jQuery UI date picker? Did you check if you're getting any JavaScript errors?
Tmdean
A: 

To me it seems that you want...

$('.date-pick').datepick();

But I'm looking at the 3.7.4 version of Datepicker (freshly downloaded from the jQuery site). Based on your element that imports the Datepicker plugin, I'm not sure we're looking at the same version.

My example works for me using your markup.

Drew Wills
A: 

Are you including jQuery.ui.core js file?

Are you including the DatePicker CSS files (ui.core.css and ui.datepicker.css)? Sometimes it works but you can't see it the way it should look because there are no styles in place.

sabanito
A: 

Thank you all

It didnt seem to work with jquery.min, but it works with jquery.js

Thanks guys