Adding A Tab Programmatically (in UI TAbs)

Adding A Tab Programmatically (in UI TAbs)


Hi folks...
i been poking around in the documentation and can't seem to get my
head around what seems to be - or should be - a fairly trivial task :
( for a tab-based appo
My problem is this....
I have a tab set that is dynamic ( I want to be able to add or delete
tabs at will ) using UI Tabs
so basically HTML sumtin like this
<div id="tabs">
    <ul>
        <li><a href="#tabs-1">Page 1</a></li>
        <li><a href="#tabs-2">Page 2</a></li>
    </ul>
    <div id="tabs-1">
        

Page 1 Stuff goies here.


    </div>
    <div id="tabs-2">
        

Page 2 stuff goes here.


    </div>
</div>
What i want to do is that a user has the ability to add some text to a
textarea. On completion, the text in the textarea is to be, by a
submit button say : -
wrapped in a div ( well i want it to be parsed and returned from
a .php file where it will be marked up appropriately but basically a
parent div is returned) ...
this i have done.. BUT
I want to be able to add the returned DIV as a NEW TAB to the tab-set
(on same page obviously) and set focus to the newly add TAB with the
added content
to give this
<div id="tabs">
    <ul>
        <li><a href="#tabs-1">Page 1</a></li>
        <li><a href="#tabs-2">Page 2</a></li>
<li><a href="#tabs-3">Page 3</a></li> *** focus on
this newly added tab
    </ul>
    <div id="tabs-1">
        

Page 1 Stuff goies here.


    </div>
    <div id="tabs-2">
        

Page 2 stuff goes here.


    </div>
<div id="tabs-3">
<div>
        

This stuff here has come from a textarea somewhere else on the
page and returned for a .php file parsed accordingly


Please please help me how to do it :(


<div>
    </div>
</div>
TO be honest, i am totally stumped on this :( Cant seem to get access
to the add tab method and transfer focus to it :(
Help will be greatly appreciated thanks
Thx in advance
Alex