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

Question

Question

Submit Buttons when using Pagination

asked on August 18, 2017

Is there a way to show the Submit button options at the bottom below the comments box when using Pagination? Currently we use Pagination to show read-only information from previous steps in a shorter form with less scrolling.  Users always have to go to the last tab just to hit the submit button even though the info on the last tab may be read-only for reference purposes.

The comments box shows up on each tab, but the submit buttons do not. We're using forms 10.2.1.205.

1 0

Answer

SELECTED ANSWER
replied on August 18, 2017 Show version history

Honestly, the easiest way to go is Custom HTML elements on each page.

Add a custom HTML element and drop in the following HTML:

<div class="btn-wrapper"><input type="submit" class="action-btn checkRequired Submit" name="action" aria-labelledby="action" value="Submit"></div>

Should work as a submit button without the need for custom JavaScript or anything.

You'll need some CSS to get the style to match exactly since the form elements have extra padding and such, but this will get you 90% of the way there.

1 0

Replies

replied on December 26, 2019
$(document).ready( function() {
  $('.cf-pagination-tabs li').click(function(){
      $('.btn-wrapper input[type=submit]').removeClass('hidden');  
  });
    
  $('.cf-pagination-tabs li').eq(0).trigger('click');
});

I have used this code to have the submit button appear on each tab of a form. When the next button is clicked to navigate through the form, the submit button disappears on each tab and is only visible on the last tab. Any suggestions? 

Thanks! 

 

 

 

2 0
replied on March 5, 2021 Show version history

I reworked this code so that it also gets triggered when they use the previous and next buttons. Also note the name of the button wrapper changes depending on if is an initiation/submission form or a form after that. So I included both options. You will just need to un-comment the line needed and comment out the line not needed depending on what type fo form you are using.  I made the function because I did not like needing to edit the code in multiple places.

 

$(document).ready(function(){

  /*******************************************************************************/
  /*                    START: show Submit button on each tab                    */
  /*******************************************************************************/ 
  function showButtonWrapper() {
    /* used for initiation/submission form */ 
    $('.btn-wrapper input[type=submit]').removeClass('hidden');
    /* used after initiation/submission form*/
    //$('.button-wrap input[type=submit]').removeClass('hidden');
    
  };
    
    
  
  /* next button clicked */
  $(document).on('click','.cf-next-btn ',function(){    
    showButtonWrapper()
  }); 

  /* Previous button clicked */
  $(document).on('click','.cf-prev-btn ',function(){    
    showButtonWrapper()
  });
  
  /* tab  clicked */
  $('.cf-pagination-tabs li').click(function(){
    showButtonWrapper();
  }); 

  $('.cf-pagination-tabs li').eq(0).trigger('click');
  /*******************************************************************************/
  /*                     END: show Submit button on each tab                     */
  /*******************************************************************************/

}); /* END: $(document).ready (function () */

EDIT: moved "$('.cf-pagination-tabs li').eq(0).trigger('click');" to end of code.

2 0
replied on October 4, 2022

My team and I have now found a way to use CSS to show the 'wrapper' the buttons are in on every tab. Note that the 'wrapper' class name changes depending on if it's the initial task or any other task in the process. That is why there are two lines of CSS code. 

 

/* Show buttons on all tabs */
.btn-wrapper input[type=submit] {display: initial!important;}/* used for initial submission task */ 
.button-wrap input[type=submit] {display: initial!important;}/* used after initial submission task*/

 

1 0
replied on August 18, 2017

I don't think pagination is intended to work that way because it is meant to be a progression, Start > Finish.

You could create a custom html element on each page and put a button in there that triggers the Submit button, but that would appear above the "previous/next" buttons so you'd need some CSS maneuvering to get it to look clean.

It sounds like collapse-able sections might be more appropriate for this situation, but if you're dead-set on pagination, custom HTML, CSS, and JavaScript can make this happen.

0 0
replied on August 18, 2017

I could see that possibly being a primary use for the Pagination, but the settings on the form let you pick if you want Previous/Next buttons to be displayed at all and if it should be displayed as Navigation Tabs, Navigation DropDown, a Progress Bar or to hide them completely.  

Our Forms have a collection with about 10 fields in it that typically is filled out with multiple items per form. Having them collapse within a section makes it more difficult for reviewers to be able to go to that collection directly on our forms. The pages also help separate out what a previous person entered from the data this step needs to focus on. It's more for providing context that is easily available to the person currently acting on the form in the process, which yes could also be done with a collapsible section as well.

When using Navigation Tabs, it doesn't imply that you should have to progress through the tabs just to get to the submit button. I didn't expect the submit buttons to be at the very end of the process when the comments are always available.

I think it is hidden because it is automatically added to the end of the page which happens to be grouped into whatever content is in the last page regardless of the pagination settings being used. The submit buttons are within their own DIV at the end of the page. I think I could use some JS/CSS to make it visible at all times and not be associated to the end of the page.

I'll have to work with this some more but it seems like it'd be pretty simple.

0 0
replied on August 18, 2017 Show version history

The previous/next buttons are only optional if you choose the tab or dropdown options because those provide an alternative navigation method.

If you select progress bar or "none" the buttons are automatically added and cannot be disabled without custom CSS/JavaScript.

Like I said, you can do it relatively easily with HTML/CSS/JavaScript, especially if you hide the navigation buttons.

On one of my forms I actually hide the default previous and next buttons and use my own custom ones as an intermediary so I can do page-by-page validation.

0 0
replied on August 18, 2017

Good to know. I hadn't caught that the option disappears.

Thanks for your help. I'll try working with the customization idea.

0 0
SELECTED ANSWER
replied on August 18, 2017 Show version history

Honestly, the easiest way to go is Custom HTML elements on each page.

Add a custom HTML element and drop in the following HTML:

<div class="btn-wrapper"><input type="submit" class="action-btn checkRequired Submit" name="action" aria-labelledby="action" value="Submit"></div>

Should work as a submit button without the need for custom JavaScript or anything.

You'll need some CSS to get the style to match exactly since the form elements have extra padding and such, but this will get you 90% of the way there.

1 0
replied on August 18, 2017

Thanks Jason!

0 0
replied on September 2, 2017

Actually Pagination/Tabbing hides Submit button. We can make it visible for each tab as below:

$('.cf-pagination-tabs li').click(function(){
      $('.btn-wrapper input[type=submit]').removeClass('hidden');  
  });
    
  $('.cf-pagination-tabs li').eq(0).trigger('click');

4 0
replied on February 9, 2018

I am needing some similar to this as well.  I have two other  navigation tabs (Page Breaks) beside the main page.  Those other two tabs are all read only and the user does not need to do anything at this time except know that the tabs are there.  How can I have the submit button on the main page so they do not have to go to the other tabs?

0 0
replied on March 22, 2018

For anyone else coming across this page, this is what I did with @████████ JavaScript above to get it working for me.

$(document).ready( function() {
  $('.cf-pagination-tabs li').click(function(){
      $('.btn-wrapper input[type=submit]').removeClass('hidden');  
  });
    
  $('.cf-pagination-tabs li').eq(0).trigger('click');
});

A Submit button then appears at the bottom of each page

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

Sign in to reply to this post.