Discussions

Expand all | Collapse all

Open tab section within a form via a link

  • 1.  Open tab section within a form via a link

    Posted 01-12-2018 21:07
    Hi,
    Is there a way for me to link to a particular form but have that form open up with a particular tab ? At the moment, the form always opens on the first tab. But i'd like it to automatically navigate to the particular tab based on external factors. This will allow the user to still be able to go to any section they want after that but their focus is first focussed at the tab that needs attention.

    Thanks!


  • 2.  RE: Open tab section within a form via a link

    Posted 01-15-2018 17:28
    Anyone?


  • 3.  RE: Open tab section within a form via a link

    Posted 01-16-2018 19:40
    Currently the tabbed forms do not have anchors built into them in order to open a form on a specific tab. It is something we do have as feedback for enhancing our tabs in forms but I always encourage our Users with questions like this to make sure that you input these needs in our User Voice to give us a better idea how much desire there is to see such a feature go live in the future. UserVoice is our Feedback Platform- which can most easily be accessed from the My Apps page in Quick Base by clicking on the orange Feedback tab that appears on the left hand side of the page or at http://quickbase.uservoice.com .  This forum is used by our development team to explore customer suggestions for enhancements / changes to the platform.


  • 4.  RE: Open tab section within a form via a link

    Posted 01-16-2018 19:49
    Anyone have any innovative ideas on this ? May be via IOL ? 


  • 5.  RE: Open tab section within a form via a link

    Posted 01-16-2018 20:33
    Essential IOL code: 

    $("#tab_t2_link a").click();

    where #tab_t2_link is the id of the <li> that surronds the <a> of the section. You can inspect the element to locate the relevant id to use and test the above code from the console.


  • 6.  RE: Open tab section within a form via a link

    Posted 01-16-2018 20:43
    Thanks! But is there anyway for me to have a url that is present on a different form to navigate and take me to a new form with the desired tab opened ?


  • 7.  RE: Open tab section within a form via a link

    Posted 01-17-2018 01:46
    Set up IOL with code similar to this:

    (function(){
      var querystring=document.location.search;
      if(/a=er/i.test(querystring)) {
        var urlParams = new URLSearchParams(window.location.search);
        if (urlParams.has("tab")) {
          $('#${urlParams.get("tab")} a').click();
        }
      }
    })();:

    Then form a URL with a query parameter named "tab" that identified the <li> containing the <a> of the tab you want to open:

    https://SUBDOMAIN.quickbase.com/db/DBID?a=er&rid=600&dfid=15&tab=tab_t2_link

    Notes:

    (1) substitute your SUBDOMAIN and DBID

    (2) substitute your tab parameter

    (3) I only implemented the code for edit records pages.

    (4) Test manually in Chrome. I used the methods URLSearchParams() and urlParams() which may or may not be supported in your browser. Easy to provide alternate code if needed.

    (5) If there is no &tab= parameter the code will run on the appropriate pages but it will  not change anything. 

    (6) This is a general technique of passing an custom parameter on the URL which can be used for many different purposes.


  • 8.  RE: Open tab section within a form via a link

    Posted 01-17-2018 17:01
    Thank you so much!!! This solution is highly appreciated!! IOL to the rescue!! 
    If you could be kind enough and also help out on the other thread with google map integration into a form, i'd be highly obliged!! 
     (https://community.quickbase.com/quickbase/topics/request-for-iol-to-integrate-google-map-on-form-to-retrieve-latitude-longitude


  • 9.  RE: Open tab section within a form via a link

    Posted 06-05-2018 18:43
    Can you guys explain this for us noobs.

    I currently implemented IOL on the form, made a code page called "Tab.JS" with the code below:
    (function(){
      var querystring=document.location.search;
      if(/a=er/i.test(querystring)) {
        var urlParams = new URLSearchParams(window.location.search);
        if (urlParams.has("tab")) {
          $('#${urlParams.get("tab")} a').click();
        }
      }
    })();:

    and i made a URL button using the sample url above. The tab link for the tab i want to get to is tab_t30_link.

    I havent used the $("#tab_t2_link a").click(); snippet. Is this where my issue is?


  • 10.  RE: Open tab section within a form via a link

    Posted 06-06-2018 13:41
    What the code does is on an edit record page it looks for a query parameter named tag and if it is is found generates a click event on that tab.

    Since the code uses URLSearchParams you have to use a supported browser:

    https://caniuse.com/#feat=urlsearchparams