[英]Tabbed Content: Show latest tab on page load
i have a basic tabbed content showing forms in each. 我有一个基本的选项卡式内容,分别显示了表格。 example of my site below.
下面是我的网站的示例。
user submits form, and when page reloads it shows the default first tab. 用户提交表单,并在页面重新加载时显示默认的第一个标签。 has anyone found a solution for this?
有没有人找到解决方案? the goal if i am on third tab for example, and i hit submit form in that tab, when page reloads it loads the third tab instead of first one?
目标,例如,如果我在第三个选项卡上,并且在该选项卡中命中了提交表单,则在页面重新加载时会加载第三个选项卡而不是第一个选项卡?
i am sure i could write some hacky javascript such as: 我确信我可以写一些hacky javascript,例如:
if form submit
check what tab ID form was submitted
force tab open on page load
but i have a feeling in 2017 we have came up with a better solution for this type of instance. 但我有一种感觉,在2017年,我们为此类实例提出了更好的解决方案。 i appreciate your time and energy reviewing my questions.
感谢您花费时间和精力回顾我的问题。
Thanks to 2017, you have many possible solutions. 多亏了2017,您有了许多可能的解决方案。 One of them should be match to your situation:
其中之一应符合您的情况:
Forget 3 and 4 and work on solution 1 or 2, please. 请忘记3和4,然后尝试解决方案1或2。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.