Forum Discussion

LorraineChung's avatar
LorraineChung
Qrew Trainee
7 years ago

how do I create a button that allows the user to continue to the next tab

We are creating a public form with multiple sections. Using the new tab section makes the form looks a lot neater, which is great, but there doesn't seem to be a way for us to indicate to the user where they are in the form and direct them to the next tab. 
Does anyone know how to create a button where the user can be redirected to the next tab? Or save and redirect to the next tab, or a field that is in the next tab? 

Also, this is a very noob question, but where can I find the url for my form which removes the Quickbase header and tabs? 
And how do I embedd the form into an iframe? 

If it's embedded in an iframe, when I look at it on a mobile, does it default to the QB mobile view? 

Thanks in advance

27 Replies

  • AlexWilkinson's avatar
    AlexWilkinson
    Qrew Assistant Captain
    Can you screenshot or copy-paste how you are hiding the 2nd tab? I am trying to find out if your scenario hides the 2nd tab before or after the "Save & next tab" button gets clicked. The button click should happen after the tab is hidden, not before. Conceptually, you need something like this:
    • Button is hidden when tab 1 is visited.
    • User enters data. When they have entered enough so that you know tab 2 should be hidden, hide it.
    • Then show the button.
    Referring to an earlier comment above, one part of this solution is probably a formula-checkbox field called "Show Tab2" that controls whether tab should be visible.
  • having trouble getting image uploaded.  to try to describe the scenario ... on tab 1, the button sits at the bottom of the form from the beginning (e.g. it is always shown).  The user answers multiple questions on the form.  The last MC question (Yes or No) sits just above the button.  If the user selects yes, the 2nd tab shows up (the 2nd tab is otherwise hidden).  The 2nd tab is hidden from the start and only shows when Yes is selected to that question.  If the user selects No then it remains hidden.  In this latter scenario, the button, when clicked, should go to the 3rd tab that is always shown.  I hope this helps?!


    • AlexWilkinson's avatar
      AlexWilkinson
      Qrew Assistant Captain
      Very helpful. I was able to create a test form (modified from one of my production apps) with settings that exactly match those you described. And, yes, the test form reproduced exactly the behavior you described. I'd like your scenario to work for my own apps, so I will start debugging the test form. I'll post a solution here, if I am able to find one.
    • AlexWilkinson's avatar
      AlexWilkinson
      Qrew Assistant Captain
      Modifying just the first line of the script seems to solve the problem. Here's the full script:

      var nextTabLink=$("li.ui-tabs-selected").nextAll(":visible").children("a:first");
      $("#saveAndKeepWorkingMenuOption").click();
      var noErrorDialog=$('#qbDialog').length==0;
      if( noErrorDialog ){
      $(nextTabLink).click();
      location.assign("#mainBodyDiv");
      };
  • This is an excellent write-up and solved a problem for me.  Thank you!

    And of course, I do have a question - is there a way to have a Save button at the end of the completion of the fields on the various tabs?  

    I want to proceed this way:
    In the Add form, the user fills out tab 1, 2 and 3 and then saves the record by hitting a Save button somewhere which takes them either to completed record or back out to dashboard.  .

    In the Edit form (it is a different form), they can edit anywhere and save from anywhere - not sure I'll need the Next buttons on that form. 

    Thanks!!!
    • ChrisSwirtz3's avatar
      ChrisSwirtz3
      Qrew Member
      Does this method still work with new Java Script rules?

      ------------------------------
      Chris Swirtz
      ------------------------------
  • This code is broken as of 11/5/19

    ------------------------------
    GMacri
    ------------------------------
    • EverettPatterso's avatar
      EverettPatterso
      Qrew Captain
      Quick Base can change the page elements anytime as updates are released. This may affect custom code and may require updates to the custom code.

      It appears they updated a CSS class for the tabs, you will need to update the part of code that calls on the li.class

      (Change li.ui-tabs-selected to li.ui-tabs-active)
      var nextTabLink=$("li.ui-tabs-active").next("[style!='display:none']").children("a");​


      ------------------------------
      Everett Patterson
      ------------------------------
      • GiuseppeMacri's avatar
        GiuseppeMacri
        Qrew Captain
        So when i tried the code in the console, worked no problem. When i tried to migrate it to a JS page, it no longer works.

        Thoughts?>

        ------------------------------
        GMacri
        ------------------------------