0
您好我使用jQuery ui選項卡Widget在頁面上有兩個選項卡。每個頁面都包含一個具有相同頁面作爲操作的表單。 我需要留在提交表單後提交表單的選項卡中。 我該如何做到這一點?jquery ui選項卡在表單提交後留在選項卡
這裏是我的代碼:
<div id="tabs">
<ul>
<li><a href="#tabs-1">Tab 1</a></li>
<li><a href="#tabs-2">Tab 2</a></li>
</ul>
<div id="tabs-1">
<p>I'm Tab1.</p>
<p>I'm a Form using GET Method, passing values to this same page:<br></p>
<p><form name="input" action="index.php" method="GET">
<input type="text" name="value" id="somevalue" style="width:150px;"> <br>
</form></p>
<?
if (isset($_GET)) {echo ($_GET['value']);}
?>
</div>
<div id="tabs-2">
<p>I'm Tab2.</p>
<p>I'm a Form using GET Method, passing values to this same page:<br></p>
<p><form name="input" action="index.php" method="GET">
<input type="text" name="value2" id="somevalue" style="width:150px;"> <br>
</form></p>
<?
if (isset($_GET)) {echo ($_GET['value2']);}
?>
</div>
</div>
在此先感謝。 塞巴斯蒂安
非常感謝,非常明確的答案 – sms
對於像我這樣仍然使用舊版jQuery的開發者:使用'select'而不是激活,使用'ui.index'來檢索選定的索引並使用製表符。標籤(「select」,activeTabIndex)選擇pr操作標籤。 –