May 10, 2016 at 23:25 #11458Naomi R MenaParticipant
With the tabs in Dynamic forms, is there a way to remember which tab was chosen last when entering a new item. Ex: Card, Home Loans, Deposits, when I click on new item I enter it from the Deposits tab. After I save the item, I created a loop to come back to the dialog box so that a new item can be created. However, the tab automatically defaults back to “Card” instead of remembering I was on the “Deposits” tab. Any suggestions? Thanks!
May 13, 2016 at 22:08 #11526Alexander BautzKeymaster
The “Use cookie to remember selected tab” functionality in the Misc tab doesn’t currently apply to NewForm, but you can set your redirect url with the paramenter “sTab=[tabIndex]” – like this:
The current selected tab can be obtained from this variable:
Hope this helps,
May 19, 2016 at 16:22 #11666Naomi R MenaParticipant
Thank you for response. Based on your suggestions we used the below JS code to input within dynamic forms. However, it still goes back to the first “Card” tab and does not stay on the tab we are currently using.
var URL = location.pathname.replace(‘NewForm.aspx’,’NewForm.aspx’);
var myTab = spjs.dffs.data.selectedTab;
URL += “?sTab=” + myTab + “&IsDlg=1”;
May 20, 2016 at 00:47 #11689KaseyParticipant
I was trying to help Naomi out and what she didn’t include in her last comment is that on save of a new item in full view the tab is remembered. When in dialog it is not. We looked at the properties of the new dialog after save and the sTab parameter was not passed as it should be. We tried to update the code to put the sTab parameter in front of the IsDLG parameter and that broke it completely and after save the user is taken to the default view instead of a new dialog. Hope these details help.
May 24, 2016 at 06:55 #11716Alexander BautzKeymaster
Using the IsDlg=1 attribute will not actually redirect you to a new dialog – it is only a keyword for hiding all other things than the form when using a dialog. You can test this by modifying your URL to include this attribute in a non-dialog page.
In case you want to use a “&” in an URL query string like this, you must escape it to “%26”.
Regarding the sTab attribute in the URL – you might need to escape the “?” in the sTab attribute like this:
- You must be logged in to reply to this topic.