views:

258

answers:

1

Hi, I've a Jquery's UI datepicker and some UI Tabs displaying some datas via AJAX (in ASP.NET 1.1...), I would like to update all Tabs object when I select a new date.

Could everyone help me?????

This is my code:

<script type="text/javascript">
function getId(){
 var TabSel = $('#tabs').tabs('tabsselect').val();
 return TabSel
}
function getDate(){
 var dataPick = $('#datepicker').val();
 return dataPick
}
$(document).ready(function() {
  $.datepicker.setDefaults($.extend({showMonthAfterYear: false}, $.datepicker.regional['it']));
  $("#datepicker").datepicker(
  {showOn: 'button', defaultDate: '-1w', showDefault: true, buttonImage: 'images/cal.gif', buttonImageOnly: false,
   altField: '#alternate', altFormat: 'yymmdd'}
  );

  $('#datepicker').datepicker({
   onSelect: function(dateText, inst) { 
         //change the tabs here.
    $('#tabs').tabs({ 
    spinner: '<b>Caricamento in corso....</b>',
    ajaxOptions: { data: { id: getId, seldate: getDate}}
    });

   }
   });
 });
</script>
</HEAD>
<body>
 <div class="demo">
  <p>Data: <input type="text" id="datepicker" value="01/10/2009" ><input type="hidden" id="alternate" > 
  </p><br> 
  <div id="tabs">
   <ul>
    <li>
     <a href="Tab1.aspx" id="Tab1">Tab1</a>
    <li>
     <a href="Tab2.aspx" id="Tab2">Tab2</a>
    <li>
     <a href="Tab3.aspx" id="Tab3">Tab3</a>
    </li>
   </ul>
  </div>
 </div> <!-- End demo -->
</body>

Thanks a lot.

Alessandro

A: 

Implement the tab changes in the onSelect method of the jQuery Datepicker.

$('#datepicker').datepicker({
   onSelect: function(dateText, inst) { 
       //change the tabs here.
   }
});
Esk
Thanks Esk. I've tried your code, but I think I still make some errors.I've update my question with the code....Thanks 4 your help!Alessandro
rossale