Redirect do EditForm on Specified tab
- This topic has 5 replies, 2 voices, and was last updated 5 years, 4 months ago by .
Viewing 5 reply threads
Viewing 5 reply threads
- You must be logged in to reply to this topic.
Home › Forums › General discussion › Redirect do EditForm on Specified tab
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
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
Will check on this and return later for feedback
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.
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
Yes that’s it was missing the “how to get the source id”. Really appreciate your help, once again 😉