如何在重定向后选择第二个选项卡? [英] How to selected second tab in after redirect?
本文介绍了如何在重定向后选择第二个选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的先生,
我在索引表格中使用了两个标签。新闻和订单包装形式。如果我点击ordersbagged中的链接,那么该页面将转到OrdersDetails页面。然后单击OrdersDetails中的Back按钮,它将转到Index页面,默认选项卡是News selected,但我想选择Orderbagged选项卡。请帮帮我..
我的第一个标签是tab1,第二个标签是tab2
我尝试过:
< script type = text / javascript>
$( document )。ready( function (){
$(< span class =code-string> #tab2)。trigger(' 点击');
});
< / script>
解决方案
( document ) .ready( function (){
( #tab2)。触发器(' click' );
});
< / script>
1。在表单上放置一个隐藏字段,给它任意ID
,例如id =selectedTabHiddenField
2.在选项卡上单击,将selectedTabHiddenField的值设置为与所选选项卡的Id相同。
例如
Dear Sir,
I have use two tab in my Index form. News and OrdersBagged forms. if i click the link in ordersbagged , then the page will go to OrdersDetails page. Then click Back button in OrdersDetails it will go to Index page the default tab is News selected , but i want to select Orderbagged tab. please help me..
My first tab id is tab1 and Second tab id is tab2
What I have tried:
<script type="text/javascript">
$(document).ready(function () {
$("#tab2").trigger('click');
});
</script>
解决方案
(document).ready(function () {
("#tab2").trigger('click'); }); </script>
1. Put a hidden field on your form give it any Id
e.g. id="selectedTabHiddenField"
2. On tab click, set the value of "selectedTabHiddenField" to same as Id of selected tab.
e.g.
这篇关于如何在重定向后选择第二个选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文