Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Jquery example broken

By: a guest on May 29th, 2012  |  syntax: JavaScript  |  size: 1.15 KB  |  views: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Jquery example NOT working.
  2.  
  3. <script type="text/javascript">
  4. $(document).ready(function()
  5. {
  6.    var jQueryDatePicker1Opts =
  7.    {
  8.       dateFormat: 'd/mm/yy',
  9.       changeMonth: true,
  10.       changeYear: true,
  11.       showButtonPanel: false,
  12.       showAnim: 'show',
  13.           minDate: -5,
  14.           numberOfMonths: 3
  15.    };
  16.    $("#jQueryDatePicker1").datepicker(jQueryDatePicker1Opts);
  17.     var jQueryDatePicker2Opts =
  18.    {
  19.       dateFormat: 'd/mm/yy',
  20.       changeMonth: true,
  21.       changeYear: true,
  22.       showButtonPanel: false,
  23.       showAnim: 'show',
  24.           minDate: -0,
  25.           numberOfMonths: 3
  26.    };
  27.    $("#jQueryDatePicker2").datepicker(jQueryDatePicker2Opts);
  28. $('#jQueryDatePicker2').datepicker({
  29.    onClose: function(dateText, inst) { alert("clicked datepicker2"); }
  30. });
  31. $('#jQueryDatePicker1').datepicker({
  32.    onClose: function(dateText, inst) { alert("clicked datepicker1"); }
  33. });  
  34. });
  35. </script>
  36.  
  37. Works only if you remove "$('#jQueryDatePicker2').datepicker({
  38.    onClose: function(dateText, inst) { alert("clicked datepicker2"); }
  39. });
  40. $('#jQueryDatePicker1').datepicker({
  41.    onClose: function(dateText, inst) { alert("clicked datepicker1"); }
  42. });  "