title: How to get the selected tab panel element in Jquery UI Tabs?
body: <p>The problem. I have multiple tab, their content is loaded via ajax, so the div id's of tabs' panels are assigned dynamically. I have a form in one, ajaxified by <a href="http://malsup.com/jquery/form/" rel="noreferrer">this jquery plugin</a> by a callback function bound to tabs.load event I pass it one parameter, the ui.panel, so that the ajaxForm() knows the target where to load result:</p>
  
  <pre><code>function initAjaxForms(loadtab)
  {
     $('form').ajaxForm({target:loadtab, success:initAjaxForms});
  } 
  </code></pre>
  
  <p>This works fine, EXCEPT when I submit the form and PHP returns it as not valid, I cannot ajaxify it anymore (of course, the function is called with no loadtab parameter). the perfect solution would be to have more options to tabs so that i can do something like this:</p>
  
  <pre><code>function initAjaxForms()
  {
     var selected = $('tabs').tabs('option', 'selectedpanel');
     $('form').ajaxForm({target:selectedpanel, success:initAjaxForms});
  } 
  </code></pre>
  
  <p>but this is obviously not it. Any ideas?</p>