Redirect do EditForm on Specified tab

Home Forums General discussion Redirect do EditForm on Specified tab

Viewing 5 reply threads
  • Author
    Posts
    • #33896
      Filipe Ribeiro
      Participant

        Hello

        I’m adding a button in DispForm, for when the date is expired the user can add new date. Is it possible, with js to redirect to EditForm on a specified tab (only with date field and other ones)?

        Note: all tabs are hidden

      • #33901
        Alexander Bautz
        Keymaster

          Hi,
          You can link to a specific tab by adding the sTab query string parameter to the URL like this:

          /Lists/DFFS_TestList/EditForm.aspx?ID=52&sTab=5

          If you want to show a specific tab when entering EditForm from this link you can add another query string parameter like this:

          /Lists/DFFS_TestList/EditForm.aspx?ID=52&sTab=5&ShowChangeDatetab=1

          Now create a rule in your EditForm that triggers on “Selected tab index / Tab unique ID” = “ShowChangeDatetab=1” and show / hide your selected tabs.

          Alexander

        • #33958
          Filipe Ribeiro
          Participant

            Will check on this and return later for feedback

          • #34036
            Filipe Ribeiro
            Participant

              Hi again,

              I didn’t quite follow how to proceed to this solution.

              Was thinking on another solution that was to open a modal of the form with the EditForm (on that specific tab) but I’m still blocked on the part that’s how to open the correct ID form/tab.

            • #34041
              Alexander Bautz
              Keymaster

                You can add a button on DispForm with code like this to redirect to EditForm. Add this in a HTML section:

                <input type="button" value="Open EditForm" onclick="goToEditForm();return false;">

                Now put this in your Custom JS:

                function goToEditForm(){
                    location.href = "/Sites/YourSite/Lists/YourList/EditForm.aspx?ID=" + spjs.dffs.data.thisItemID + "&sTab=5";
                }

                Change 5 to whatever index your tab has in EditForm.

                Alexander

              • #34047
                Filipe Ribeiro
                Participant

                  Yes that’s it was missing the “how to get the source id”. Really appreciate your help, once again 😉

              Viewing 5 reply threads
              • You must be logged in to reply to this topic.