Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>create tab with <code>active: 0</code> (assuming index of <code>search</code> tab is 0 that is it is the first tab) on click event of tab heading of <code>details</code> create tab again with <code>active: 0</code> on search validation <code>unbind</code> <code>click</code> event from <code>details tab</code> and trigger <code>click</code> on <code>a</code> tag inside the heading <code>li</code> of <code>details</code> tab once <code>details tab</code> is opened again bind it's click event to create <code>tabs</code> with <code>active: 0</code></p> <pre><code>&lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#tabs-1"&gt;Search&lt;/a&gt;&lt;/li&gt; &lt;li id="deactive"&gt;&lt;a href="#tabs-2"&gt;Details&lt;/a&gt;&lt;/li&gt; //add id deactive &lt;/ul&gt; &lt;div id="tabs-1"&gt; &lt;input id="search" type="text" /&gt; &lt;button&gt;Search&lt;/button&gt; &lt;/div&gt; &lt;div id="tabs-2"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>script</strong></p> <pre><code>$("#tabs").tabs({ active: 0 }); $('#deactive').click(function () { $('#tabs').tabs({ active: 0 //refer to api documentation of jquery ui-tabs }) }) $('button').click(function () { var value = $('#search').val().toLowerCase() if (value == " your comparison/validation criteria ") { $('#deactive').unbind('click') $('#deactive &gt;a').trigger('click') $('#deactive').click(function () { $('#tabs').tabs({ active: 0 //refer to api documentation of jquery ui-tabs }) }) } }) </code></pre> <p><a href="http://jsfiddle.net/PAm5t/" rel="nofollow"><strong>CLICK HERE FOR DEMO</strong></a></p> <p><a href="http://jsfiddle.net/UD_B/PAm5t/2/" rel="nofollow"><strong>DEMO FOR POPULATING DETAILS TAB ON THE BASIS OF SEARCH</strong></a></p> <p><strong>NOTE</strong> that this will keep the <code>DETAILS TAB</code> disabled all time, if you don't want this behavior you have to tailor the code as per your requirement</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload