JQuery Date Select and Gantry

By Tim Keefer
Apr 5 2007 7:49 p.m.

Here are some code snippets dealing with a JQuery date select plugin and Gantry.

Bigtop file

field shipped {
  is             datetime;
  label          Shipped;
  html_form_type text;
  html_form_display_size 10;
  html_form_class `date-picker`;
  html_form_optional 1;
}
Gantry form method
{
  display_size => 10,
  name => 'shipped',
  class => 'date-picker',
  optional => 1,
  label => 'Shipped',
  type => 'text',
  is => 'datetime',
},
HTML

snippet from from the site wrapper

<script src="[% self.doc_rootp %]/js/jquery.js" 
    charset="utf-8" type="text/javascript"></script>
<script src="[% self.doc_rootp %]/js/datePicker.js" 
    charset="utf-8" type="text/javascript"></script>

<script>
    $(document).ready(init);
    function init() {
        $.datePicker.setDateFormat('mdy','/');
          $('input#shipped').datePicker();
}
</script>

 <input type="text" name="shipped" id="shipped" value="" />

Comments

  • Speedovation.com
    Jun 20 2008 4:12 a.m

    Nice script..that helps me

Post a comment

two wheels and a seat