Thanks Klaus,

works perfectly.

ger

On Nov 4, 11:47 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> My bad. Try this instead:
>
> var $tabs = $('#staff-tab > ul').tabs({ cookie: { expires: 30 } });
> $('a', $tabs).click(function() {
>     if ( $(this).parent().hasClass('ui-tabs-selected') ) {
>         $tabs.tabs('load', $('a', $tabs).index(this));
>     }
>
> });
>
> --Klaus
>
> On 4 Nov., 23:19, fleabo <[EMAIL PROTECTED]> wrote:
>
>
>
> > I've used your code like this (maybe it's not the right way);
>
> >                 <script type='text/javascript'>
> >                 $(document).ready(function(){
> >                         var $tabs = $('#staff-tab > ul').tabs({
> >                             select: function(e, ui) {
> >                                 if (ui.index === 
> > $tabs.data('selected.tabs')) {
> >                                     $tabs.tabs('load', ui.index);
> >                                 }
> >                             }
> >                         });
> >                 });
> >                 </script>
> > but nothing seems to happen (using firebug I don't see any anything
> > and no errors) when I click on the selected tab. The tabs work as
> > before. I'm using ui.jquery (themeroller).
>
> > Ger
>
> > On Nov 4, 8:24 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
>
> > > Well, if the tab initially loads that form, the code I've posted
> > > should work.
>
> > > --Klaus
>
> > > On 4 Nov., 17:57,bogno<[EMAIL PROTECTED]> wrote:
>
> > > > Sorry, should of specified. I want to reload a blank (original load) 
> > > > form. I
> > > > am using it for a ticket system, so if someone wants to submit a second
> > > > ticket, all they have to do is click on the tab to get an empty form.
>
> > > > At present I use the tabs option { unselect: true } which works but 
> > > > requires
> > > > two clicks on tab, first to unselect, second to reselect.
>
> > > > thanks
>
> > > > Klaus Hartl-4 wrote:
>
> > > > > What does "reload the form" mean? Reloading the result of the formerly
> > > > > submitted form or load a blank form again? The former will be a bit
> > > > > more complicated.
>
> > > > > --Klaus
>
> > > > > On 4 Nov., 14:34,bogno<[EMAIL PROTECTED]> wrote:
> > > > >> I can't seem to get this to work.
>
> > > > >> I have a tab that I load a form into, submit the form via ajax and 
> > > > >> return
> > > > >> a
> > > > >> view which replaces the form in the tab. So far everything works ok. 
> > > > >> I
> > > > >> would
> > > > >> then like to have the possibility for the user to click on the 
> > > > >> active tab
> > > > >> so
> > > > >> as to reload the form. My tabs are set up as such.
>
> > > > >> <script>
> > > > >>         $(function() {
> > > > >>                 $('#staff-tab > ul').tabs({ cookie: { expires: 30 } 
> > > > >> });
> > > > >>         });
> > > > >> </script>
> > > > >> <div id="staff-tab">
> > > > >>         <ul>
> > > > >>                 <li> staff/get/current/ Current </li>
> > > > >>                 <li> staff/get/finished/ Finished </li>
> > > > >>                 <li> staff/get/register/  Register </li>
> > > > >>         </ul>
> > > > >> </div>
>
> > > > >> Klaus Hartl-4 wrote:
>
> > > > >> > var $tabs = $('#example').tabs({
> > > > >> >     select: function(e, ui) {
> > > > >> >         if (ui.index === $tabs.data('selected.tabs')) {
> > > > >> >             $tabs.tabs('load', ui.index);
> > > > >> >         }
> > > > >> >     }
> > > > >> > });
>
> > > > >> > --Klaus
>
> > > > >> > On 23 Okt., 16:58, fleabo <[EMAIL PROTECTED]> wrote:
> > > > >> >> Is it possible to click on the selected tab so as to reload this 
> > > > >> >> tab?
>
> > > > >> >> thanks
>
> > > > >> --
> > > > >> View this message in
> > > > >> context:http://www.nabble.com/Tabs---Preserve-onclick-on-selected-tab-tp20132...
> > > > >> Sent from the jQuery General Discussion mailing list archive at
> > > > >> Nabble.com.
>
> > > > --
> > > > View this message in 
> > > > context:http://www.nabble.com/Tabs---Preserve-onclick-on-selected-tab-tp20132...
> > > > Sent from the jQuery General Discussion mailing list archive at 
> > > > Nabble.com.

Reply via email to