You are viewing limited content. For full access, please sign in.

Question

Question

Forms: Open form on specific forms tab

asked on February 4, 2018 Show version history

Hi there,

I have a form using pagination with two (2) tabs.

By default when the form loads it opens on the first tab.

Is there a way I can default the form to open on the second tab instead of the first tab, without changing the order of the tabs?

Example attached.

Thanks in advance.

screeb-shot02.png
0 0

Answer

SELECTED ANSWER
replied on February 6, 2018

Hi Tim,

You can try the following custom script:

$(document).ready(function(){
  $(".cf-page.active").removeClass("active");
  $(".cf-page:eq(1)").addClass("active");
  $(".cf-pagination-tabs li.active").removeClass("active");
  $(".cf-pagination-tabs li:eq(1)").addClass("active");
  $("#form1").trigger("updatePagination");
});

:eq(1) means the second tab.

1 0
replied on July 26, 2019

This works great for what page is displayed!

In my scenario, I am using the 'dropdown' method for displaying the different pages rather than the Tabs. While the page is loading to my "page 4" the dropdown is displaying "page 1". Do you have a way to have the dropdown update to reflect the page it is displaying?

replied on July 26, 2019 Show version history

This works great for what page is displayed!

In my scenario, I am using the 'dropdown' method for displaying the different pages rather than the Tabs. While the page is loading to my "page 4" the dropdown is displaying "page 1". With some digging I found if I add the following code, it will display the right page in the dropdown:

 

$(.cf-pagination-dropdown).val('q99');

In my instance, q99 is the css identifier for "page 4"

Now, I'd like a way to make this dynamic rather than hard coding for the page.

I'd like to determine how many "pages" there are on the current Form and then use that variable to automatically load the last page for the user. Any recommendations?

0 0
replied on July 28, 2019

Hi Michael,

You could use the following script to always find the last page:

$(document).ready(function(){
  $(".cf-page.active").removeClass("active");
  $(".cf-page:last").addClass("active");
  $(".cf-pagination-dropdown").val($(".cf-page:last").attr("id"));
  $("#form1").trigger("updatePagination");
});

 

2 0
replied on July 29, 2019

Thanks! That does exactly what I needed.

0 0
replied on December 5, 2022

I know this is an old thread, but, we want to do the same thing--have a the last ("overview") tab be the initial tab when the form loads. The CSS above works, but as Micheal mentioned, it shows the last tab, but the highlighted tab is the first one. I tried this, but get the same result.

$(document).ready(function(){
  $(".cf-page.active").removeClass("active");
  $(".cf-page:last").addClass("active");
  $(".cf-pagination-tabs").val($(".cf-page:last").attr("id"));
  $("#form1").trigger("updatePagination");
});

How can I fix this to open the last tab and highlight the correct tab in the navigation bar? 

Thanks.

0 0

Replies

replied on February 14, 2018

Great - thanks for your assistance!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.